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:
Alexander 2015-08-21 00:40:42 -04:00
parent 8ace2358ae
commit 688979c93e

View file

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