def main(): load_client_config() #config contains all the constants for the game # make sure that 2 clients running on the same machine log into 2 separate files clientid = str(current_thread().ident) clogger = config_logger(clientid) clogger.debug('Client started') em = ClientEventManager() # These components are shared with bots. Their config is given to them. fps = config_get_fps() clock = CClockController(em, fps) #main loop is in there hostport = config_get_hostport() nick = config_get_nick() n = NetworkController(em, hostport, nick) g = Game(em) # These components are specific to human clients. # They can grab the client config themselves. kb = InputController(em) mv = MasterView(em) clock.start() clogger.debug('Client stopped')
def main(): load_bot_config() # bot-specific config (e.g. logger) tid = current_thread().ident logger = config_logger(str(tid)) logger.debug('Client started') evManager = ClientEventManager() clock = CClockController(evManager, config_get_fps()) #the main loop is in there g = Game(evManager) n = NetworkController(evManager, config_get_hostport(), config_get_nick()) ic = BotInputController(evManager, g) # simulate inputs clock.start() logger.debug('Client stopped')