From 688979c93e0b211193ae8a3ac63bc72673992176 Mon Sep 17 00:00:00 2001 From: Alexander Date: Fri, 21 Aug 2015 00:40:42 -0400 Subject: [PATCH] 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. --- toontown/ai/DistributedReportMgrAI.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/toontown/ai/DistributedReportMgrAI.py b/toontown/ai/DistributedReportMgrAI.py index 02122868..7fd4724d 100755 --- a/toontown/ai/DistributedReportMgrAI.py +++ b/toontown/ai/DistributedReportMgrAI.py @@ -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