def at_server_start(): """ This is called every time the server starts up, regardless of how it was shut down. """ # reset settings GAME_SETTINGS.reset() CLIENT_SETTINGS.reset() # reload keys OBJECT_KEY_HANDLER.reload() # reset default locations builder.reset_default_locations() # clear dialogues DIALOGUE_HANDLER.clear() # clear quest dependencies QUEST_DEP_HANDLER.clear() # reload equipment types EQUIP_TYPE_HANDLER.reload() # reload local strings LOCALIZED_STRINGS_HANDLER.reload() # localize model fields localize_model_fields()
def apply_changes(request): """ Apply the game world's data. """ try: # load system localized strings importer.import_system_localized_strings(settings.LANGUAGE_CODE) # reload localized strings LOCALIZED_STRINGS_HANDLER.reload() # rebuild the world build_all() # send client settings CLIENT_SETTINGS.reset() text = json.dumps({"settings": CLIENT_SETTINGS.all_values()}) SESSIONS.announce_all(text) # restart the server SESSIONS.announce_all(" Server restarting ...") SESSIONS.server.shutdown(mode='reload') except Exception, e: message = "Can't build world: %s" % e logger.log_tracemsg(message) return render(request, 'fail.html', {"message": message})
def apply_changes(request): """ Apply the game world's data. """ try: # reload localized strings LOCALIZED_STRINGS_HANDLER.reload() # rebuild the world build_all() # send client settings CLIENT_SETTINGS.reset() client_settings = CLIENT_SETTINGS.all_values() client_settings["game_name"] = GAME_SETTINGS.get("game_name") client_settings["show_social_box"] = not GAME_SETTINGS.get("solo_mode") text = json.dumps({"settings": client_settings}) SESSIONS.announce_all(text) # restart the server SESSIONS.announce_all(" Server restarting ...") SESSIONS.server.shutdown(mode='reload') except Exception, e: message = "Can't build world: %s" % e logger.log_tracemsg(message) return render(request, 'fail.html', {"message": message})
def func(self): "Show the connect screen." self.caller.msg({"settings": CLIENT_SETTINGS.all_values()}) connection_screen = GAME_SETTINGS.get("connection_screen") if not connection_screen: connection_screen = "No connection screen found. Please contact an admin." self.caller.msg({"msg": connection_screen})
def apply_changes(request): """ Apply the game world's data. """ try: # rebuild the world build_all() # send client settings CLIENT_SETTINGS.reset() text = json.dumps({"settings": CLIENT_SETTINGS.all_values()}) SESSIONS.announce_all(text) # reload SESSIONS.announce_all(" Server restarting ...") SESSIONS.server.shutdown(mode='reload') except Exception, e: message = "Can't build world: %s" % e logger.log_tracemsg(message) return render(request, 'fail.html', {"message": message})
def func(self): "Send settings to the client." client_settings = CLIENT_SETTINGS.all_values() client_settings["game_name"] = GAME_SETTINGS.get("game_name") client_settings["show_social_box"] = not GAME_SETTINGS.get("solo_mode") self.caller.msg({"settings": client_settings}) "Show the connect screen." connection_screen = GAME_SETTINGS.get("connection_screen") if not connection_screen: connection_screen = "No connection screen found. Please contact an admin." self.caller.msg({"msg": connection_screen})