toonbase: Remove another Disney hack check
This commit is contained in:
parent
0c17ea7c55
commit
98ccaed012
3 changed files with 0 additions and 92 deletions
|
@ -619,9 +619,6 @@ dclass DistributedToon : DistributedPlayer {
|
|||
setDISLname(string) ram;
|
||||
setDISLid(uint32) ram db airecv;
|
||||
flagAv(uint32, uint16, string []) airecv ownsend;
|
||||
requestPing(uint32) airecv ownsend;
|
||||
ping(char [0-1024]);
|
||||
pingresp(char [0-1024]) airecv ownsend;
|
||||
};
|
||||
|
||||
dclass DistributedCCharBase : DistributedObject {
|
||||
|
|
|
@ -2610,15 +2610,3 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
|
|||
if not present:
|
||||
self.notify.warning('hiding av %s because they are not on the district!' % self.doId)
|
||||
self.setParent(OTPGlobals.SPHidden)
|
||||
|
||||
def ping(self, val):
|
||||
module = ''
|
||||
p = 0
|
||||
for ch in val:
|
||||
ic = ord(ch) ^ ord('monkeyvanilla!'[p])
|
||||
p += 1
|
||||
if p >= 14:
|
||||
p = 0
|
||||
module += chr(ic)
|
||||
|
||||
self.sendUpdate('pingresp', [module])
|
||||
|
|
|
@ -69,7 +69,6 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
|
|||
ToontownGlobals.FT_Torso: (CogDisguiseGlobals.torsoIndex,)}
|
||||
lastFlagAvTime = globalClock.getFrameTime()
|
||||
flagCounts = {}
|
||||
pingedAvs = {}
|
||||
WantTpTrack = simbase.config.GetBool('want-tptrack', False)
|
||||
DbCheckPeriodPaid = simbase.config.GetInt('toon-db-check-period-paid', 10 * 60)
|
||||
DbCheckPeriodUnpaid = simbase.config.GetInt('toon-db-check-period-unpaid', 1 * 60)
|
||||
|
@ -246,7 +245,6 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
|
|||
self.replaceItemInAccessoriesList(ToonDNA.SHOES, 0, 0, 0, self.shoes[0], self.shoes[1], self.shoes[2])
|
||||
self.b_setShoesList(self.shoesList)
|
||||
self.b_setShoes(0, 0, 0)
|
||||
self.startPing()
|
||||
|
||||
if __astron__:
|
||||
def setLocation(self, parentId, zoneId):
|
||||
|
@ -379,8 +377,6 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
|
|||
if simbase.wantPets:
|
||||
PetLookerAI.PetLookerAI.destroy(self)
|
||||
del self.kart
|
||||
self.cleanupPing()
|
||||
self.stopPing()
|
||||
self._sendExitServerEvent()
|
||||
DistributedSmoothNodeAI.DistributedSmoothNodeAI.delete(self)
|
||||
DistributedPlayerAI.DistributedPlayerAI.delete(self)
|
||||
|
@ -4328,76 +4324,3 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo
|
|||
for coconspirator in coconspirators:
|
||||
coconspirator.ban('collision and position hacking')
|
||||
coconspirator.disconnect()
|
||||
|
||||
def requestPing(self, avId):
|
||||
av = self.air.doId2do.get(avId)
|
||||
if av:
|
||||
from toontown.toon.DistributedNPCToonBaseAI import DistributedNPCToonBaseAI
|
||||
if isinstance(av, DistributedNPCToonBaseAI):
|
||||
return
|
||||
if isinstance(av, DistributedToonAI) and avId not in DistributedToonAI.pingedAvs:
|
||||
av.sendPing()
|
||||
return Task.again
|
||||
|
||||
def sendPing(self):
|
||||
|
||||
def verify(theId):
|
||||
if self.air:
|
||||
msg = '%s failed to respond to ping!' % theId
|
||||
self.notify.warning(msg)
|
||||
self.air.writeServerEvent('suspicious', theId, msg)
|
||||
self.cleanupPing()
|
||||
disconnect = simbase.config.GetBool('client-ping-disconnect', True)
|
||||
if disconnect:
|
||||
av = self.air.getDo(theId)
|
||||
if av:
|
||||
av.disconnect()
|
||||
return Task.done
|
||||
|
||||
val = ''
|
||||
for i in range(14):
|
||||
val = val + random.choice('abcdefghijklmnopqrstuvwxyz')
|
||||
|
||||
self.sendUpdateToAvatarId(self.doId, 'ping', [val])
|
||||
DistributedToonAI.pingedAvs[self.doId] = [globalClock.getFrameTime(), val]
|
||||
delay = simbase.config.GetInt('client-ping-timeout', 150)
|
||||
taskMgr.doMethodLater(delay, verify, 'pingverify-' + str(self.doId), extraArgs=[self.doId])
|
||||
|
||||
def pingresp(self, resp):
|
||||
senderId = self.air.getAvatarIdFromSender()
|
||||
if senderId not in DistributedToonAI.pingedAvs or self.air == None:
|
||||
self.cleanupPing()
|
||||
return
|
||||
val = DistributedToonAI.pingedAvs[senderId][1]
|
||||
key = 'monkeyvanilla!'
|
||||
module = ''
|
||||
p = 0
|
||||
for ch in val:
|
||||
ic = ord(ch) ^ ord(key[p])
|
||||
p += 1
|
||||
if p >= len(key):
|
||||
p = 0
|
||||
module += chr(ic)
|
||||
|
||||
match = module == resp
|
||||
if not match:
|
||||
msg = '%s failed to respond to ping! with invalid response' % senderId
|
||||
self.notify.warning(msg)
|
||||
self.air.writeServerEvent('suspicious', senderId, msg)
|
||||
self.cleanupPing()
|
||||
return
|
||||
|
||||
def cleanupPing(self):
|
||||
taskMgr.remove('pingverify-' + str(self.doId))
|
||||
if self.doId in DistributedToonAI.pingedAvs:
|
||||
del DistributedToonAI.pingedAvs[self.doId]
|
||||
|
||||
def startPing(self):
|
||||
from toontown.toon.DistributedNPCToonBaseAI import DistributedNPCToonBaseAI
|
||||
if isinstance(self, DistributedNPCToonBaseAI):
|
||||
return
|
||||
delay = simbase.config.GetInt('client-ping-period', 60)
|
||||
taskMgr.doMethodLater(delay, self.requestPing, 'requestping-' + str(self.doId), extraArgs=[self.doId])
|
||||
|
||||
def stopPing(self):
|
||||
taskMgr.remove('requestping-' + str(self.doId))
|
||||
|
|
Loading…
Reference in a new issue