Beispiel #1
0
        public List <GameProfileAchievement> GetList(List <Dictionary <string, object> > dictList)
        {
            data.Clear();

            foreach (Dictionary <string, object> dict in dictList)
            {
                foreach (KeyValuePair <string, object> obj in dict)
                {
                    GameProfileAchievement objectValue = (GameProfileAchievement)obj.Value;
                    objectValue.FillFromDictionary(dict);
                    data.Add(objectValue);
                }
            }

            return(data);
        }
Beispiel #2
0
 public virtual bool SetGameProfileAchievementByUuidByCode(GameProfileAchievement obj)
 {
     return act.SetGameProfileAchievementByUuidByCode(DEFAULT_SET_TYPE, obj);
 }
Beispiel #3
0
 public virtual bool SetGameProfileAchievementByUuidByCode(SetType set_type, GameProfileAchievement obj)
 {
     return act.SetGameProfileAchievementByUuidByCode(ConvertSetTypeToString(set_type), obj);
 }
Beispiel #4
0
 //------------------------------------------------------------------------------
 public virtual bool SetGameProfileAchievementByUuidByCode(string set_type, GameProfileAchievement obj)
 {
     return act.SetGameProfileAchievementByUuidByCode(set_type, obj);
 }
Beispiel #5
0
 public virtual bool SetGameProfileAchievementByCodeByProfileIdByGameIdByTimestamp(GameProfileAchievement obj)
 {
     return act.SetGameProfileAchievementByCodeByProfileIdByGameIdByTimestamp(DEFAULT_SET_TYPE, obj);
 }
Beispiel #6
0
 public virtual bool SetGameProfileAchievementByCodeByProfileIdByGameIdByTimestamp(SetType set_type, GameProfileAchievement obj)
 {
     return act.SetGameProfileAchievementByCodeByProfileIdByGameIdByTimestamp(ConvertSetTypeToString(set_type), obj);
 }
Beispiel #7
0
 //------------------------------------------------------------------------------
 public virtual bool SetGameProfileAchievementByCodeByProfileIdByGameIdByTimestamp(string set_type, GameProfileAchievement obj)
 {
     return act.SetGameProfileAchievementByCodeByProfileIdByGameIdByTimestamp(set_type, obj);
 }
Beispiel #8
0
        //------------------------------------------------------------------------------
        public virtual bool SetGameProfileAchievementByUuidByCode(string set_type, GameProfileAchievement obj)
        {
            List<SqlParameter> parameters
                = new List<SqlParameter>();
            parameters.Add(new SqlParameter("@set_type", set_type));
            parameters.Add(new SqlParameter("@status", obj.status));
            parameters.Add(new SqlParameter("@username", obj.username));
            parameters.Add(new SqlParameter("@code", obj.code));
            parameters.Add(new SqlParameter("@timestamp", obj.timestamp));
            parameters.Add(new SqlParameter("@completed", obj.completed));
            parameters.Add(new SqlParameter("@profile_id", obj.profile_id));
            parameters.Add(new SqlParameter("@active", obj.active));
            parameters.Add(new SqlParameter("@game_id", obj.game_id));
            parameters.Add(new SqlParameter("@achievement_value", obj.achievement_value));
            parameters.Add(new SqlParameter("@data", obj.data));
            parameters.Add(new SqlParameter("@uuid", obj.uuid));
            parameters.Add(new SqlParameter("@date_modified", obj.date_modified));
            parameters.Add(new SqlParameter("@level", obj.level));
            parameters.Add(new SqlParameter("@date_created", obj.date_created));
            parameters.Add(new SqlParameter("@type", obj.type));

            try {
                return (bool)data.ExecuteScalar(
                BaseGamingData.connectionString
                , CommandType.StoredProcedure
                , "usp_game_profile_achievement_set_by_uuid_by_code"
                , parameters
                );
            }
            catch (Exception e){
                log.Error(e);
                return false;
            }
        }
Beispiel #9
0
        //------------------------------------------------------------------------------
        public virtual bool SetGameProfileAchievementByUuid(string set_type, GameProfileAchievement obj)
        {
            List<NpgsqlParameter> parameters
                = new List<NpgsqlParameter>();
            parameters.Add(new NpgsqlParameter("in_set_type", set_type));
            parameters.Add(new NpgsqlParameter("in_status", obj.status));
            parameters.Add(new NpgsqlParameter("in_username", obj.username));
            parameters.Add(new NpgsqlParameter("in_code", obj.code));
            parameters.Add(new NpgsqlParameter("in_timestamp", obj.timestamp));
            parameters.Add(new NpgsqlParameter("in_completed", obj.completed));
            parameters.Add(new NpgsqlParameter("in_profile_id", obj.profile_id));
            parameters.Add(new NpgsqlParameter("in_active", obj.active));
            parameters.Add(new NpgsqlParameter("in_game_id", obj.game_id));
            parameters.Add(new NpgsqlParameter("in_achievement_value", obj.achievement_value));
            parameters.Add(new NpgsqlParameter("in_data", obj.data));
            parameters.Add(new NpgsqlParameter("in_uuid", obj.uuid));
            parameters.Add(new NpgsqlParameter("in_date_modified", obj.date_modified));
            parameters.Add(new NpgsqlParameter("in_level", obj.level));
            parameters.Add(new NpgsqlParameter("in_date_created", obj.date_created));
            parameters.Add(new NpgsqlParameter("in_type", obj.type));

            try {
                return Convert.ToBoolean(data.ExecuteScalar(
                BaseGamingData.connectionString
                , CommandType.StoredProcedure
                , "usp_game_profile_achievement_set_uuid"
                , parameters
                ));
            }
            catch (Exception e){
                log.Error(e);
                return false;
            }
        }
Beispiel #10
0
        public virtual GameProfileAchievement FillGameProfileAchievement(DataRow dr)
        {
            GameProfileAchievement obj = new GameProfileAchievement();

            if (dr["status"] != null)
                    obj.status = dataType.FillDataString(dr, "status");
            if (dr["username"] != null)
                    obj.username = dataType.FillDataString(dr, "username");
            if (dr["code"] != null)
                    obj.code = dataType.FillDataString(dr, "code");
            if (dr["timestamp"] != null)
                    obj.timestamp = dataType.FillDataFloat(dr, "timestamp");
            if (dr["completed"] != null)
                    obj.completed = dataType.FillDataBool(dr, "completed");
            if (dr["profile_id"] != null)
                    obj.profile_id = dataType.FillDataString(dr, "profile_id");
            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["achievement_value"] != null)
                    obj.achievement_value = dataType.FillDataFloat(dr, "achievement_value");
            if (dr["data"] != null)
                    obj.data = dataType.FillDataString(dr, "data");
            if (dr["uuid"] != null)
                    obj.uuid = dataType.FillDataString(dr, "uuid");
            if (dr["date_modified"] != null)
                    obj.date_modified = dataType.FillDataDateTime(dr, "date_modified");
            if (dr["level"] != null)
                    obj.level = dataType.FillDataString(dr, "level");
            if (dr["date_created"] != null)
                    obj.date_created = dataType.FillDataDateTime(dr, "date_created");
            if (dr["type"] != null)
                    obj.type = dataType.FillDataString(dr, "type");

            return obj;
        }
Beispiel #11
0
 public virtual bool SetGameProfileAchievementByUuid(string set_type, GameProfileAchievement obj)
 {
     return data.SetGameProfileAchievementByUuid(set_type, obj);
 }
Beispiel #12
0
 public virtual bool SetGameProfileAchievementByCodeByProfileIdByGameId(string set_type, GameProfileAchievement obj)
 {
     return data.SetGameProfileAchievementByCodeByProfileIdByGameId(set_type, obj);
 }
Beispiel #13
0
        //------------------------------------------------------------------------------
        public virtual void SetGameProfileAchievementByUuidByCode()
        {
            ResponseGameProfileAchievementBool wrapper = new ResponseGameProfileAchievementBool();
            wrapper.message = "Success";
            wrapper.code = 0;
            wrapper.action = "game-profile-achievement/set/by-uuid/by-code";

            GameProfileAchievement obj = new GameProfileAchievement();

            string _status = util.GetParamValue(_context, "status");
            if(!String.IsNullOrEmpty(_status))
                obj.status = (string)_status;

            string _username = util.GetParamValue(_context, "username");
            if(!String.IsNullOrEmpty(_username))
                obj.username = (string)_username;

            string _code = util.GetParamValue(_context, "code");
            if(!String.IsNullOrEmpty(_code))
                obj.code = (string)_code;

            string _timestamp = util.GetParamValue(_context, "timestamp");
            if(!String.IsNullOrEmpty(_timestamp))
                obj.timestamp = float.Parse(_timestamp);

            string _completed = util.GetParamValue(_context, "completed");
            if(!String.IsNullOrEmpty(_completed))
                obj.completed = Convert.ToBoolean(_completed);

            string _profile_id = util.GetParamValue(_context, "profile_id");
            if(!String.IsNullOrEmpty(_profile_id))
                obj.profile_id = (string)_profile_id;

            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 _achievement_value = util.GetParamValue(_context, "achievement_value");
            if(!String.IsNullOrEmpty(_achievement_value))
                obj.achievement_value = float.Parse(_achievement_value);

            string _data = util.GetParamValue(_context, "data");
            if(!String.IsNullOrEmpty(_data))
                obj.data = (string)_data;

            string _uuid = util.GetParamValue(_context, "uuid");
            if(!String.IsNullOrEmpty(_uuid))
                obj.uuid = (string)_uuid;

            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 _level = util.GetParamValue(_context, "level");
            if(!String.IsNullOrEmpty(_level))
                obj.level = (string)_level;

            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 _type = util.GetParamValue(_context, "type");
            if(!String.IsNullOrEmpty(_type))
                obj.type = (string)_type;

            // get data
            wrapper.data = api.SetGameProfileAchievementByUuidByCode(obj);

            util.SerializeTypeJSONToResponse(_context, wrapper);
        }