def startShow(self, cr, launcherServer=None): self.cr = cr if self.display.antialias: render.setAntialias(AntialiasAttrib.MAuto) base.graphicsEngine.renderFrame() self.downloadWatcher = ToontownDownloadWatcher.ToontownDownloadWatcher( TTLocalizer.LauncherPhaseNames) if launcher.isDownloadComplete(): self.cleanupDownloadWatcher() else: self.acceptOnce('launcherAllPhasesComplete', self.cleanupDownloadWatcher) gameServer = config.GetString('game-server', '') if gameServer: self.notify.info('Using game-server from Configrc: %s ' % gameServer) elif launcherServer: gameServer = launcherServer self.notify.info('Using gameServer from launcher: %s ' % gameServer) else: gameServer = 'localhost' serverPort = config.GetInt('server-port', 7198) serverList = [] for name in gameServer.split(';'): url = URLSpec(name, 1) if config.GetBool('server-force-ssl', False): url.setScheme('s') if not url.hasPort(): url.setPort(serverPort) serverList.append(url) if len(serverList) == 1: failover = config.GetString('server-failover', '') serverURL = serverList[0] for arg in failover.split(): try: port = int(arg) url = URLSpec(serverURL) url.setPort(port) except: url = URLSpec(arg, 1) if url != serverURL: serverList.append(url) cr.loginFSM.request('connect', [serverList]) self.ttAccess = ToontownAccess.ToontownAccess() self.ttAccess.initModuleInfo() if config.GetBool('want-speedhack-fix', False): # Start checking for speedhacks. self.lastSpeedhackCheck = time.time() self.trueClock = TrueClock.getGlobalPtr() self.lastTrueClockTime = self.trueClock.getLongTime() taskMgr.add(self.__speedhackCheckTick, 'speedhack-tick')
def startShow(self, cr, launcherServer=None): self.cr = cr base.graphicsEngine.renderFrame() self.downloadWatcher = ToontownDownloadWatcher.ToontownDownloadWatcher( TTLocalizer.LauncherPhaseNames) if launcher.isDownloadComplete(): self.cleanupDownloadWatcher() else: self.acceptOnce('launcherAllPhasesComplete', self.cleanupDownloadWatcher) gameServer = os.environ.get('TTI_GAMESERVER', 'localhost') # Get the base port. serverPort = base.config.GetInt('server-port', 7199) # Get the number of client-agents. clientagents = base.config.GetInt('client-agents', 1) - 1 # Get a new port. serverPort += (random.randint(0, clientagents) * 100) serverList = [] for name in gameServer.split(';'): url = URLSpec(name, 1) if base.config.GetBool('server-force-ssl', False): url.setScheme('s') if not url.hasPort(): url.setPort(serverPort) serverList.append(url) if len(serverList) == 1: failover = base.config.GetString('server-failover', '') serverURL = serverList[0] for arg in failover.split(): try: port = int(arg) url = URLSpec(serverURL) url.setPort(port) except: url = URLSpec(arg, 1) if url != serverURL: serverList.append(url) cr.loginFSM.request('connect', [serverList]) self.ttAccess = ToontownAccess.ToontownAccess() self.ttAccess.initModuleInfo() # Start detecting speed hacks: self.lastSpeedHackCheck = time.time() self.lastTrueClockTime = TrueClock.getGlobalPtr().getLongTime() taskMgr.add(self.__speedHackCheckTick, 'speedHackCheck-tick')
def startShow(self, cr, launcherServer=None): self.cr = cr if base.config.GetBool('framebuffer-multisample', False): render.setAntialias(AntialiasAttrib.MAuto) base.graphicsEngine.renderFrame() self.downloadWatcher = ToontownDownloadWatcher.ToontownDownloadWatcher( TTLocalizer.LauncherPhaseNames) if launcher.isDownloadComplete(): self.cleanupDownloadWatcher() else: self.acceptOnce('launcherAllPhasesComplete', self.cleanupDownloadWatcher) gameServer = base.config.GetString('game-server', '') if gameServer: self.notify.info('Using game-server from Configrc: %s ' % gameServer) else: if launcherServer: gameServer = launcherServer self.notify.info('Using gameServer from launcher: %s ' % gameServer) else: gameServer = '127.0.0.1' serverPort = base.config.GetInt('server-port', 7198) serverList = [] for name in gameServer.split(';'): url = URLSpec(name, 1) if config.GetBool('want-ssl', False): url.setScheme('s') if not url.hasPort(): url.setPort(serverPort) serverList.append(url) if len(serverList) == 1: failover = base.config.GetString('server-failover', '') serverURL = serverList[0] for arg in failover.split(): try: port = int(arg) url = URLSpec(serverURL) url.setPort(port) except: url = URLSpec(arg, 1) if url != serverURL: serverList.append(url) cr.loginFSM.request('connect', [serverList]) self.ttAccess = ToontownAccess.ToontownAccess() self.ttAccess.initModuleInfo()