def _add_game_port_to_game_base(game_id): game_base = app_settings.GAME_SERVER_URL_FUNCTION(game_id)[0] game_port = app_settings.GAME_SERVER_PORT_FUNCTION(game_id) if _connection_on_k8s_mode(game_port): return game_base return "{0}:{1}".format(game_base, game_port)
def get_environment_connection_settings(game_id): """ This function will return the correct URL parts and a SSL flag based on the environment of which it exists in. :param game_id: Integer with the ID of the game. :return: A dict object with all relevant settings. """ return { "game_url_base": _add_game_port_to_game_base(game_id), "game_url_path": app_settings.GAME_SERVER_URL_FUNCTION(game_id)[1], "game_ssl_flag": app_settings.GAME_SERVER_SSL_FLAG, "game_id": game_id, }
def get_environment_connection_settings(game_id): """ This function will return the correct URL parts and a SSL flag based on the environment of which it exists in. :param request: Request object used to generate this response. :param game_id: Integer with the ID of the game. :return: A dict object with all relevant settings. """ return { 'game_url_base': _add_game_port_to_game_base(game_id), 'game_url_path': app_settings.GAME_SERVER_URL_FUNCTION(game_id)[1], 'game_ssl_flag': app_settings.GAME_SERVER_SSL_FLAG, 'game_id': game_id }