mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-23 11:42:39 -06:00
oo[pssieisss
This commit is contained in:
parent
c72e45fbc4
commit
260e5af56f
3 changed files with 39 additions and 1 deletions
|
@ -27,6 +27,7 @@ want-achievements #f
|
|||
|
||||
# Chat:
|
||||
want-whitelist #f
|
||||
want-blacklist-sequence #f
|
||||
|
||||
# Cashbot boss:
|
||||
want-resistance-toonup #t
|
||||
|
|
36
toontown/chat/TTSequenceList.py
Normal file
36
toontown/chat/TTSequenceList.py
Normal file
|
@ -0,0 +1,36 @@
|
|||
from pandac.PandaModules import *
|
||||
from otp.chat.SequenceList import SequenceList
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
|
||||
class TTSequenceList(SequenceList):
|
||||
|
||||
def __init__(self):
|
||||
self.notify = DirectNotifyGlobal.directNotify.newCategory('TTSequenceList')
|
||||
sequenceListURL = config.GetString('blacklist-sequence-url', '')
|
||||
if sequenceListURL == '':
|
||||
self.notify.warning('No Sequence BL URL specified! Continuing with local sequence.')
|
||||
SequenceList.__init__(self, self.loadSquencesLocally())
|
||||
else:
|
||||
SequenceList.__init__(self, self.downloadSequences(sequenceListURL))
|
||||
|
||||
def downloadSequences(self, url):
|
||||
fs = Ramfile()
|
||||
http = HTTPClient.getGlobalPtr()
|
||||
self.ch = http.makeChannel(True)
|
||||
self.ch.getHeader(DocumentSpec(url))
|
||||
doc = self.ch.getDocumentSpec()
|
||||
self.ch.getDocument(doc)
|
||||
self.ch.downloadToRam(fs)
|
||||
return fs.getData().split('\r\n')
|
||||
|
||||
def loadSquencesLocally(self):
|
||||
vfs = VirtualFileSystem.getGlobalPtr()
|
||||
filename = Filename('tsequence.dat')
|
||||
searchPath = DSearchPath()
|
||||
searchPath.appendDirectory(Filename('/server'))
|
||||
found = vfs.resolveFilename(filename, searchPath)
|
||||
if not found:
|
||||
self.notify.warning("Couldn't find blacklist sequence data file!")
|
||||
return
|
||||
data = vfs.readFile(filename, True)
|
||||
return data.split('\n')
|
|
@ -117,6 +117,7 @@ class DistributedSuitBaseAI(DistributedAvatarAI.DistributedAvatarAI, SuitBase.Su
|
|||
def useSkeleRevive(self):
|
||||
self.skeleRevives -= 1
|
||||
self.currHP = self.maxHP
|
||||
self.d_setHP(self.currHP)
|
||||
self.reviveFlag = 1
|
||||
|
||||
def reviveCheckAndClear(self):
|
||||
|
|
Loading…
Reference in a new issue