//------------------------------------------------------------------------------ public virtual void SetGameSessionByUuid() { ResponseGameSessionBool wrapper = new ResponseGameSessionBool(); wrapper.message = "Success"; wrapper.code = 0; wrapper.action = "game-session/set/by-uuid"; GameSession obj = new GameSession(); string _game_area = util.GetParamValue(_context, "game_area"); if(!String.IsNullOrEmpty(_game_area)) obj.game_area = (string)_game_area; string _code = util.GetParamValue(_context, "code"); if(!String.IsNullOrEmpty(_code)) obj.code = (string)_code; string _network_uuid = util.GetParamValue(_context, "network_uuid"); if(!String.IsNullOrEmpty(_network_uuid)) obj.network_uuid = (string)_network_uuid; string _profile_id = util.GetParamValue(_context, "profile_id"); if(!String.IsNullOrEmpty(_profile_id)) obj.profile_id = (string)_profile_id; string _game_level = util.GetParamValue(_context, "game_level"); if(!String.IsNullOrEmpty(_game_level)) obj.game_level = (string)_game_level; string _profile_network = util.GetParamValue(_context, "profile_network"); if(!String.IsNullOrEmpty(_profile_network)) obj.profile_network = (string)_profile_network; string _profile_device = util.GetParamValue(_context, "profile_device"); if(!String.IsNullOrEmpty(_profile_device)) obj.profile_device = (string)_profile_device; string _display_name = util.GetParamValue(_context, "display_name"); if(!String.IsNullOrEmpty(_display_name)) obj.display_name = (string)_display_name; string _uuid = util.GetParamValue(_context, "uuid"); if(!String.IsNullOrEmpty(_uuid)) obj.uuid = (string)_uuid; string _network_external_port = util.GetParamValue(_context, "network_external_port"); if(!String.IsNullOrEmpty(_network_external_port)) obj.network_external_port = Convert.ToInt32(_network_external_port); string _game_players_connected = util.GetParamValue(_context, "game_players_connected"); if(!String.IsNullOrEmpty(_game_players_connected)) obj.game_players_connected = Convert.ToInt32(_game_players_connected); string _type = util.GetParamValue(_context, "type"); if(!String.IsNullOrEmpty(_type)) obj.type = (string)_type; string _status = util.GetParamValue(_context, "status"); if(!String.IsNullOrEmpty(_status)) obj.status = (string)_status; string _game_state = util.GetParamValue(_context, "game_state"); if(!String.IsNullOrEmpty(_game_state)) obj.game_state = (string)_game_state; string _hash = util.GetParamValue(_context, "hash"); if(!String.IsNullOrEmpty(_hash)) obj.hash = (string)_hash; string _description = util.GetParamValue(_context, "description"); if(!String.IsNullOrEmpty(_description)) obj.description = (string)_description; string _network_external_ip = util.GetParamValue(_context, "network_external_ip"); if(!String.IsNullOrEmpty(_network_external_ip)) obj.network_external_ip = (string)_network_external_ip; string _profile_username = util.GetParamValue(_context, "profile_username"); if(!String.IsNullOrEmpty(_profile_username)) obj.profile_username = (string)_profile_username; string _active = util.GetParamValue(_context, "active"); if(!String.IsNullOrEmpty(_active)) obj.active = Convert.ToBoolean(_active); string _game_id = util.GetParamValue(_context, "game_id"); if(!String.IsNullOrEmpty(_game_id)) obj.game_id = (string)_game_id; string _game_code = util.GetParamValue(_context, "game_code"); if(!String.IsNullOrEmpty(_game_code)) obj.game_code = (string)_game_code; string _game_player_z = util.GetParamValue(_context, "game_player_z"); if(!String.IsNullOrEmpty(_game_player_z)) obj.game_player_z = float.Parse(_game_player_z); string _game_player_x = util.GetParamValue(_context, "game_player_x"); if(!String.IsNullOrEmpty(_game_player_x)) obj.game_player_x = float.Parse(_game_player_x); string _game_player_y = util.GetParamValue(_context, "game_player_y"); if(!String.IsNullOrEmpty(_game_player_y)) obj.game_player_y = float.Parse(_game_player_y); string _network_port = util.GetParamValue(_context, "network_port"); if(!String.IsNullOrEmpty(_network_port)) obj.network_port = Convert.ToInt32(_network_port); string _game_players_allowed = util.GetParamValue(_context, "game_players_allowed"); if(!String.IsNullOrEmpty(_game_players_allowed)) obj.game_players_allowed = Convert.ToInt32(_game_players_allowed); string _name = util.GetParamValue(_context, "name"); if(!String.IsNullOrEmpty(_name)) obj.name = (string)_name; string _date_modified = util.GetParamValue(_context, "date_modified"); if(!String.IsNullOrEmpty(_date_modified)) obj.date_modified = Convert.ToDateTime(_date_modified); else obj.date_modified = DateTime.Now; string _game_type = util.GetParamValue(_context, "game_type"); if(!String.IsNullOrEmpty(_game_type)) obj.game_type = (string)_game_type; string _date_created = util.GetParamValue(_context, "date_created"); if(!String.IsNullOrEmpty(_date_created)) obj.date_created = Convert.ToDateTime(_date_created); else obj.date_created = DateTime.Now; string _network_ip = util.GetParamValue(_context, "network_ip"); if(!String.IsNullOrEmpty(_network_ip)) obj.network_ip = (string)_network_ip; string _network_use_nat = util.GetParamValue(_context, "network_use_nat"); if(!String.IsNullOrEmpty(_network_use_nat)) obj.network_use_nat = Convert.ToBoolean(_network_use_nat); // get data wrapper.data = api.SetGameSessionByUuid(obj); util.SerializeTypeJSONToResponse(_context, wrapper); }
//------------------------------------------------------------------------------ public virtual void DelGameSessionByUuid() { string _uuid = (string)util.GetParamValue(_context, "uuid"); ResponseGameSessionBool wrapper = new ResponseGameSessionBool(); wrapper.message = "Success"; wrapper.code = 0; wrapper.action = "game-session/del/by-uuid"; bool completed = api.DelGameSessionByUuid( _uuid ); // get data wrapper.data = completed; util.SerializeTypeToResponse(_format, _context, wrapper); }