コード例 #1
0
ファイル: BaseGamingAPI.cs プロジェクト: drawcode/bom
 public virtual bool SetGameSessionByUuid(GameSession obj)
 {
     return act.SetGameSessionByUuid(DEFAULT_SET_TYPE, obj);
 }
コード例 #2
0
ファイル: BaseGamingAPI.cs プロジェクト: drawcode/bom
 public virtual bool SetGameSessionByUuid(SetType set_type, GameSession obj)
 {
     return act.SetGameSessionByUuid(ConvertSetTypeToString(set_type), obj);
 }
コード例 #3
0
ファイル: BaseGamingAPI.cs プロジェクト: drawcode/bom
 //------------------------------------------------------------------------------
 public virtual bool SetGameSessionByUuid(string set_type, GameSession obj)
 {
     return act.SetGameSessionByUuid(set_type, obj);
 }
コード例 #4
0
ファイル: BaseGamingData.cs プロジェクト: drawcode/bom
        //------------------------------------------------------------------------------
        public virtual bool SetGameSessionByUuid(string set_type, GameSession obj)
        {
            List<SqlParameter> parameters
                = new List<SqlParameter>();
            parameters.Add(new SqlParameter("@set_type", set_type));
            parameters.Add(new SqlParameter("@game_area", obj.game_area));
            parameters.Add(new SqlParameter("@code", obj.code));
            parameters.Add(new SqlParameter("@network_uuid", obj.network_uuid));
            parameters.Add(new SqlParameter("@profile_id", obj.profile_id));
            parameters.Add(new SqlParameter("@game_level", obj.game_level));
            parameters.Add(new SqlParameter("@profile_network", obj.profile_network));
            parameters.Add(new SqlParameter("@profile_device", obj.profile_device));
            parameters.Add(new SqlParameter("@display_name", obj.display_name));
            parameters.Add(new SqlParameter("@uuid", obj.uuid));
            parameters.Add(new SqlParameter("@network_external_port", obj.network_external_port));
            parameters.Add(new SqlParameter("@game_players_connected", obj.game_players_connected));
            parameters.Add(new SqlParameter("@type", obj.type));
            parameters.Add(new SqlParameter("@status", obj.status));
            parameters.Add(new SqlParameter("@game_state", obj.game_state));
            parameters.Add(new SqlParameter("@hash", obj.hash));
            parameters.Add(new SqlParameter("@description", obj.description));
            parameters.Add(new SqlParameter("@network_external_ip", obj.network_external_ip));
            parameters.Add(new SqlParameter("@profile_username", obj.profile_username));
            parameters.Add(new SqlParameter("@active", obj.active));
            parameters.Add(new SqlParameter("@game_id", obj.game_id));
            parameters.Add(new SqlParameter("@game_code", obj.game_code));
            parameters.Add(new SqlParameter("@game_player_z", obj.game_player_z));
            parameters.Add(new SqlParameter("@game_player_x", obj.game_player_x));
            parameters.Add(new SqlParameter("@game_player_y", obj.game_player_y));
            parameters.Add(new SqlParameter("@network_port", obj.network_port));
            parameters.Add(new SqlParameter("@game_players_allowed", obj.game_players_allowed));
            parameters.Add(new SqlParameter("@name", obj.name));
            parameters.Add(new SqlParameter("@date_modified", obj.date_modified));
            parameters.Add(new SqlParameter("@game_type", obj.game_type));
            parameters.Add(new SqlParameter("@date_created", obj.date_created));
            parameters.Add(new SqlParameter("@network_ip", obj.network_ip));
            parameters.Add(new SqlParameter("@network_use_nat", obj.network_use_nat));

            try {
                return (bool)data.ExecuteScalar(
                BaseGamingData.connectionString
                , CommandType.StoredProcedure
                , "usp_game_session_set_by_uuid"
                , parameters
                );
            }
            catch (Exception e){
                log.Error(e);
                return false;
            }
        }
コード例 #5
0
ファイル: BaseGamingACT.cs プロジェクト: drawcode/bom
        public virtual GameSession FillGameSession(DataRow dr)
        {
            GameSession obj = new GameSession();

            if (dr["game_area"] != null)
                    obj.game_area = dataType.FillDataString(dr, "game_area");
            if (dr["code"] != null)
                    obj.code = dataType.FillDataString(dr, "code");
            if (dr["network_uuid"] != null)
                    obj.network_uuid = dataType.FillDataString(dr, "network_uuid");
            if (dr["profile_id"] != null)
                    obj.profile_id = dataType.FillDataString(dr, "profile_id");
            if (dr["game_level"] != null)
                    obj.game_level = dataType.FillDataString(dr, "game_level");
            if (dr["profile_network"] != null)
                    obj.profile_network = dataType.FillDataString(dr, "profile_network");
            if (dr["profile_device"] != null)
                    obj.profile_device = dataType.FillDataString(dr, "profile_device");
            if (dr["display_name"] != null)
                    obj.display_name = dataType.FillDataString(dr, "display_name");
            if (dr["uuid"] != null)
                    obj.uuid = dataType.FillDataString(dr, "uuid");
            if (dr["network_external_port"] != null)
                    obj.network_external_port = dataType.FillDataInt(dr, "network_external_port");
            if (dr["game_players_connected"] != null)
                    obj.game_players_connected = dataType.FillDataInt(dr, "game_players_connected");
            if (dr["type"] != null)
                    obj.type = dataType.FillDataString(dr, "type");
            if (dr["status"] != null)
                    obj.status = dataType.FillDataString(dr, "status");
            if (dr["game_state"] != null)
                    obj.game_state = dataType.FillDataString(dr, "game_state");
            if (dr["hash"] != null)
                    obj.hash = dataType.FillDataString(dr, "hash");
            if (dr["description"] != null)
                    obj.description = dataType.FillDataString(dr, "description");
            if (dr["network_external_ip"] != null)
                    obj.network_external_ip = dataType.FillDataString(dr, "network_external_ip");
            if (dr["profile_username"] != null)
                    obj.profile_username = dataType.FillDataString(dr, "profile_username");
            if (dr["active"] != null)
                    obj.active = dataType.FillDataBool(dr, "active");
            if (dr["game_id"] != null)
                    obj.game_id = dataType.FillDataString(dr, "game_id");
            if (dr["game_code"] != null)
                    obj.game_code = dataType.FillDataString(dr, "game_code");
            if (dr["game_player_z"] != null)
                    obj.game_player_z = dataType.FillDataFloat(dr, "game_player_z");
            if (dr["game_player_x"] != null)
                    obj.game_player_x = dataType.FillDataFloat(dr, "game_player_x");
            if (dr["game_player_y"] != null)
                    obj.game_player_y = dataType.FillDataFloat(dr, "game_player_y");
            if (dr["network_port"] != null)
                    obj.network_port = dataType.FillDataInt(dr, "network_port");
            if (dr["game_players_allowed"] != null)
                    obj.game_players_allowed = dataType.FillDataInt(dr, "game_players_allowed");
            if (dr["name"] != null)
                    obj.name = dataType.FillDataString(dr, "name");
            if (dr["date_modified"] != null)
                    obj.date_modified = dataType.FillDataDateTime(dr, "date_modified");
            if (dr["game_type"] != null)
                    obj.game_type = dataType.FillDataString(dr, "game_type");
            if (dr["date_created"] != null)
                    obj.date_created = dataType.FillDataDateTime(dr, "date_created");
            if (dr["network_ip"] != null)
                    obj.network_ip = dataType.FillDataString(dr, "network_ip");
            if (dr["network_use_nat"] != null)
                    obj.network_use_nat = dataType.FillDataBool(dr, "network_use_nat");

            return obj;
        }
コード例 #6
0
ファイル: BaseGamingService.cs プロジェクト: drawcode/bom
        //------------------------------------------------------------------------------
        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);
        }