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
|
from toontown.uberdog.ClientServicesManagerUD import executeHttpRequestAndLog
|
||||||
import ReportGlobals, threading, time
|
import ReportGlobals, threading, time
|
||||||
|
|
||||||
|
# TODO: FIX
|
||||||
|
|
||||||
|
'''
|
||||||
|
THREADING.TIMER CAUSES CONTROL C NOT TO WORK, AND FOR THE AI NOT TO DIE
|
||||||
|
'''
|
||||||
|
|
||||||
class DistributedReportMgrAI(DistributedObjectAI):
|
class DistributedReportMgrAI(DistributedObjectAI):
|
||||||
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedReportMgrAI")
|
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedReportMgrAI")
|
||||||
|
|
||||||
|
@ -10,10 +16,10 @@ class DistributedReportMgrAI(DistributedObjectAI):
|
||||||
DistributedObjectAI.__init__(self, air)
|
DistributedObjectAI.__init__(self, air)
|
||||||
self.reports = []
|
self.reports = []
|
||||||
self.interval = config.GetInt('report-interval', 600)
|
self.interval = config.GetInt('report-interval', 600)
|
||||||
self.scheduleReport()
|
#self.scheduleReport()
|
||||||
|
|
||||||
def scheduleReport(self):
|
#def scheduleReport(self):
|
||||||
threading.Timer(self.interval, self.sendAllReports).start()
|
# threading.Timer(self.interval, self.sendAllReports).start()
|
||||||
|
|
||||||
def sendReport(self, avId, category):
|
def sendReport(self, avId, category):
|
||||||
if not ReportGlobals.isValidCategoryName(category) or not len(str(avId)) == 9:
|
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))
|
self.reports.append('%s|%s|%s|%s' % (timestamp, reporter.doId, avId, category))
|
||||||
|
|
||||||
def sendAllReports(self):
|
def sendAllReports(self):
|
||||||
self.scheduleReport()
|
#self.scheduleReport()
|
||||||
|
|
||||||
if not self.reports or config.GetString('accountdb-type', 'developer') != 'remote':
|
if not self.reports or config.GetString('accountdb-type', 'developer') != 'remote':
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in a new issue