Compare commits

...

10 commits

Author SHA1 Message Date
Wilee999
8a55d8720e k 2015-01-23 21:10:01 -08:00
Harvir
2e50b0a75f npc: [Patch by Goshi] Give a VP SOS Toon some DNA. 2014-08-30 16:25:48 +01:00
Anthony Castelli
441b1d71e3 estates: Potential fix for Issue #161 2014-08-29 19:01:16 -07:00
Anthony Castelli
c4b994a947 sequenial-blacklist: Properly read the local file 2014-08-29 11:43:59 -07:00
Anthony Castelli
de0d0cafc5 Resources bump 2014-08-29 10:14:37 -07:00
Anthony Castelli
f6907a1f1b trolly: Fix Ice Game rippage 2014-08-29 10:14:09 -07:00
Anthony Castelli
5517c55615 rpc: Forgot a comma... 🐬 2014-08-27 12:38:39 -07:00
Anthony Castelli
7f475f146a rpc: Add more info to the pending names for Luke 2014-08-26 07:50:47 -07:00
Harvir
815d186599 base: Rework speedhack detection to use TrueClock. 2014-08-24 11:54:53 +01:00
Anthony Castelli
c987eac453 base: Turn off the speedhack 2014-08-23 19:12:38 -07:00
11 changed files with 57 additions and 25 deletions

15
.gitignore vendored
View file

@ -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

View file

@ -9,6 +9,7 @@ sync-video #f
want-dev #f
preload-avatars #t
texture-anisotropic-degree 16
want-speedhack-fix #t
# Resource settings

View file

@ -12,6 +12,7 @@ preload-avatars #t
want-keep-alive #f
texture-anisotropic-degree 16
language LANGUAGE_HERE
want-speedhack-fix #t
# Resources settings

View file

@ -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

View file

@ -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')

View file

@ -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):

View file

@ -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

View file

@ -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],

View file

@ -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.

View file

@ -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)