Compare commits
10 commits
b189f5ecfb
...
8a55d8720e
Author | SHA1 | Date | |
---|---|---|---|
|
8a55d8720e | ||
|
2e50b0a75f | ||
|
441b1d71e3 | ||
|
c4b994a947 | ||
|
de0d0cafc5 | ||
|
f6907a1f1b | ||
|
5517c55615 | ||
|
7f475f146a | ||
|
815d186599 | ||
|
c987eac453 |
11 changed files with 57 additions and 25 deletions
15
.gitignore
vendored
15
.gitignore
vendored
|
@ -1,7 +1,8 @@
|
|||
#If you really need these you can extract them from tt.exe yourself
|
||||
*.pyc
|
||||
*.pyo
|
||||
*.dll
|
||||
*.jpg
|
||||
databases
|
||||
settings.json
|
||||
#If you really need these you can extract them from tt.exe yourself
|
||||
*.pyc
|
||||
*.pyo
|
||||
*.dll
|
||||
*.jpg
|
||||
databases
|
||||
settings.json
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ sync-video #f
|
|||
want-dev #f
|
||||
preload-avatars #t
|
||||
texture-anisotropic-degree 16
|
||||
want-speedhack-fix #t
|
||||
|
||||
|
||||
# Resource settings
|
||||
|
|
|
@ -12,6 +12,7 @@ preload-avatars #t
|
|||
want-keep-alive #f
|
||||
texture-anisotropic-degree 16
|
||||
language LANGUAGE_HERE
|
||||
want-speedhack-fix #t
|
||||
|
||||
|
||||
# Resources settings
|
||||
|
|
|
@ -2,12 +2,12 @@ class SequenceList:
|
|||
|
||||
def __init__(self, wordlist):
|
||||
self.list = {}
|
||||
for line in wordlist.split('\r\n'):
|
||||
for line in wordlist:
|
||||
if line is '':
|
||||
continue
|
||||
split = line.split(':')
|
||||
self.list[split[0].lower()] = [word.rstrip('\r\n').lower() for word in split[1].split(',')]
|
||||
|
||||
|
||||
def getList(self, word):
|
||||
if word in self.list:
|
||||
return self.list[word]
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 8ee956170cb7bdc761e0e86ed1918978b13f44f2
|
||||
Subproject commit 16a1bd16ae6bd1abe21e850f6d0cb53bab9bda8f
|
|
@ -21,7 +21,7 @@ class TTSequenceList(SequenceList):
|
|||
doc = self.ch.getDocumentSpec()
|
||||
self.ch.getDocument(doc)
|
||||
self.ch.downloadToRam(fs)
|
||||
return fs.getData()
|
||||
return fs.getData().split('\r\n')
|
||||
|
||||
def loadSquencesLocally(self):
|
||||
vfs = VirtualFileSystem.getGlobalPtr()
|
||||
|
@ -32,5 +32,5 @@ class TTSequenceList(SequenceList):
|
|||
if not found:
|
||||
self.notify.warning("Couldn't find blacklist sequence data file!")
|
||||
return
|
||||
data = vfs.readFile(filename, 1)
|
||||
return data
|
||||
data = vfs.readFile(filename, True)
|
||||
return data.split('\n')
|
||||
|
|
|
@ -338,7 +338,8 @@ class DistributedFurnitureManagerAI(DistributedObjectAI):
|
|||
|
||||
def deleteWallpaperFromAttic(self, blob, index):
|
||||
wallpaper = self.getAtticFurniture(blob, index)
|
||||
self.atticWallpaper.remove(wallpaper)
|
||||
if wallpaper in self.atticWallpaper:
|
||||
self.atticWallpaper.remove(wallpaper)
|
||||
self.b_setAtticWallpaper(self.getAtticWallpaper())
|
||||
|
||||
def moveWindowToAttic(self, slot):
|
||||
|
|
|
@ -1049,8 +1049,6 @@ class DistributedIceGame(DistributedMinigame.DistributedMinigame, DistributedIce
|
|||
self.tireSounds[tireIndex]['wallHit'].play()
|
||||
elif c0 == self.obstacleCollideId:
|
||||
self.tireSounds[tireIndex]['obstacleHit'].play()
|
||||
else:
|
||||
self.notify.error('Couldn\'t find any collisions!')
|
||||
|
||||
def forceLocalToonToTire(self):
|
||||
toon = localAvatar
|
||||
|
|
|
@ -7081,9 +7081,22 @@ NPCToonDict = {
|
|||
NPC_REGULAR),
|
||||
4219: (4717,
|
||||
lnames[4219],
|
||||
'r',
|
||||
('dss',
|
||||
'ms',
|
||||
'm',
|
||||
'm',
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
11,
|
||||
0,
|
||||
11,
|
||||
1,
|
||||
1),
|
||||
'm',
|
||||
1,
|
||||
NPC_REGULAR),
|
||||
4220: (4718,
|
||||
lnames[4220],
|
||||
|
|
|
@ -28,6 +28,7 @@ from sys import platform
|
|||
from DisplayOptions import DisplayOptions
|
||||
import otp.ai.DiagnosticMagicWords
|
||||
import time
|
||||
from panda3d.core import TrueClock
|
||||
|
||||
class ToonBase(OTPBase.OTPBase):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory('ToonBase')
|
||||
|
@ -425,21 +426,29 @@ class ToonBase(OTPBase.OTPBase):
|
|||
self.ttAccess = ToontownAccess.ToontownAccess()
|
||||
self.ttAccess.initModuleInfo()
|
||||
|
||||
# Start checking for speedhacks.
|
||||
self.lastSpeedhackCheck = time.time()
|
||||
taskMgr.doMethodLater(config.GetFloat('speedhack-interval', 10.0), self.__speedhackCheckTick, 'speedhack-tick')
|
||||
if config.GetBool('want-speedhack-fix', False):
|
||||
# Start checking for speedhacks.
|
||||
self.lastSpeedhackCheck = time.time()
|
||||
self.trueClock = TrueClock.getGlobalPtr()
|
||||
self.lastTrueClockTime = self.trueClock.getLongTime()
|
||||
taskMgr.add(self.__speedhackCheckTick, 'speedhack-tick')
|
||||
|
||||
def __speedhackCheckTick(self, task):
|
||||
# Check if the time elapsed is less than interval-1 (1 second extra just in case)
|
||||
# Compare the time elapsed for time.time() and TrueClock. If the TrueClock is more
|
||||
# than 1 second ahead, assume that it's running faster than normal.
|
||||
# If the system time is dragged backwards between 2 iterations, this might cause
|
||||
# problems (as the TrueClock would then be ahead).
|
||||
elapsed = time.time() - self.lastSpeedhackCheck
|
||||
if elapsed < config.GetFloat('speedhack-interval', 10.0) - 1:
|
||||
# They responded too fast. This indicates that the TaskManager is running faster
|
||||
tc_elapsed = self.trueClock.getLongTime() - self.lastTrueClockTime
|
||||
if tc_elapsed > elapsed + 1:
|
||||
# They responded too fast. This indicates that the TrueClock is running faster
|
||||
# than normal, and possibly means they sped the process up.
|
||||
self.__killSpeedHacker()
|
||||
return task.done
|
||||
# Clean! Lets wait until the next iteration...
|
||||
self.lastSpeedhackCheck = time.time()
|
||||
return task.again
|
||||
self.lastTrueClockTime = self.trueClock.getLongTime()
|
||||
return task.cont
|
||||
|
||||
def __killSpeedHacker(self):
|
||||
# go fuck yo' self and yo' cheat engine, fuck'r.
|
||||
|
|
|
@ -173,10 +173,18 @@ class ToontownRPCHandler:
|
|||
|
||||
result = []
|
||||
for item in cursor:
|
||||
dna = ToonDNA.ToonDNA()
|
||||
dna.makeFromNetString(item['fields']['setDNAString']['dnaString'])
|
||||
|
||||
obj = {
|
||||
'avId': item['_id'],
|
||||
'name': item['fields']['WishName'],
|
||||
'time': item['fields']['WishNameTimestamp']
|
||||
'time': item['fields']['WishNameTimestamp'],
|
||||
'dna': {
|
||||
'species': ToonDNA.getSpeciesName(dna.head),
|
||||
'headType': dna.head,
|
||||
'headColor': list(ToonDNA.allColorsList[dna.headColor]),
|
||||
}
|
||||
}
|
||||
result.append(obj)
|
||||
|
||||
|
|
Loading…
Reference in a new issue