mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2025-01-09 17:53:50 +00:00
Control C now works when you use it and the server will crash and reboot if it does crash. TODO: fix report manager to not use threading.
This commit is contained in:
parent
8ace2358ae
commit
688979c93e
1 changed files with 10 additions and 4 deletions
|
@ -3,6 +3,12 @@ from direct.distributed.DistributedObjectAI import DistributedObjectAI
|
|||
from toontown.uberdog.ClientServicesManagerUD import executeHttpRequestAndLog
|
||||
import ReportGlobals, threading, time
|
||||
|
||||
# TODO: FIX
|
||||
|
||||
'''
|
||||
THREADING.TIMER CAUSES CONTROL C NOT TO WORK, AND FOR THE AI NOT TO DIE
|
||||
'''
|
||||
|
||||
class DistributedReportMgrAI(DistributedObjectAI):
|
||||
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedReportMgrAI")
|
||||
|
||||
|
@ -10,10 +16,10 @@ class DistributedReportMgrAI(DistributedObjectAI):
|
|||
DistributedObjectAI.__init__(self, air)
|
||||
self.reports = []
|
||||
self.interval = config.GetInt('report-interval', 600)
|
||||
self.scheduleReport()
|
||||
#self.scheduleReport()
|
||||
|
||||
def scheduleReport(self):
|
||||
threading.Timer(self.interval, self.sendAllReports).start()
|
||||
#def scheduleReport(self):
|
||||
# threading.Timer(self.interval, self.sendAllReports).start()
|
||||
|
||||
def sendReport(self, avId, category):
|
||||
if not ReportGlobals.isValidCategoryName(category) or not len(str(avId)) == 9:
|
||||
|
@ -28,7 +34,7 @@ class DistributedReportMgrAI(DistributedObjectAI):
|
|||
self.reports.append('%s|%s|%s|%s' % (timestamp, reporter.doId, avId, category))
|
||||
|
||||
def sendAllReports(self):
|
||||
self.scheduleReport()
|
||||
#self.scheduleReport()
|
||||
|
||||
if not self.reports or config.GetString('accountdb-type', 'developer') != 'remote':
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue