def __init__(self): DEBUG_MSG( "======================= LoginPoller .__init__ =======================" ) self._callback = None self._loginName = "" KBEngine.addTimer(0.3, 0, onTornadoIOLoop)
def onLoginAppReady(): """ KBEngine method. interfaces已经准备好了 """ INFO_MSG('onLoginAppReady: bootstrapGroupIndex=%s, bootstrapGlobalIndex=%s' % \ (os.getenv("KBE_BOOTIDX_GROUP"), os.getenv("KBE_BOOTIDX_GLOBAL"))) KBEngine.addTimer(0.01, 1.0, onTick)
def onInterfaceAppReady(): """ KBEngine method. interfaces已经准备好了 """ INFO_MSG('onInterfaceAppReady: bootstrapGroupIndex=%s, bootstrapGlobalIndex=%s' % \ (os.getenv("KBE_BOOTIDX_GROUP"), os.getenv("KBE_BOOTIDX_GLOBAL"))) KBEngine.addTimer(0.01, 1.0, onTick) g_poller.start("localhost", 30040)
def __init__(self): DEBUG_MSG("======================= LoginPoller .__init__ =======================") self._callback = None self._loginName = "" self.startTime = None self.endTime = None self.count = 0 self.isFirst = True self.totalTime = 0.0 #tornado.ioloop.IOLoop.current().start() KBEngine.addTimer(0, 0.01, onTornadoIOLoop)
def open_async(self): assert self.app not in ("base", "cell") settings = get_module("settings") AsyncHttp = get_module_attr("common.asyncHttp.AsyncHttp") asyncio_loop = get_module_attr("common.asyncio.asyncio_loop") def onAsyncHttpTick(timerID): AsyncHttp.run_frame() def onAsyncioTick(timerID): asyncio_loop.run_frame() gameTimeInterval = settings.Global.gameTimeInterval if self.app == "bots": gameTimeInterval *= 2 if settings.Global.enableAsyncHttp: KBEngine.addTimer(gameTimeInterval, gameTimeInterval, onAsyncHttpTick) if settings.Global.enableAsyncio: KBEngine.addTimer(gameTimeInterval, gameTimeInterval, onAsyncioTick)
def onTornadoIOLoop(timerID): KBEngine.delTimer(timerID) tornado.ioloop.IOLoop.current().start() KBEngine.addTimer(0.3, 0, onTornadoIOLoop)