public void SetInfo(DBDecorateItem msg) { if (msg.HasId) { m_uiID = msg.Id; } if (msg.HasType) { m_uiType = msg.Type; } if (msg.HasEndTime) { m_uiEndTime = msg.EndTime; } return; }
public DBDecorateItem GetData(uint gid) { DBDecorateItem ad = null; if (data.TryGetValue(gid, out ad)) { return(ad); } string query = string.Format("SELECT * FROM {0} WHERE {0}.{1}=\"{2}\"", mTableName, "gid", gid); var reader = DBManager.Instance.ExecuteSqliteQueryToReader(GlobalConfig.DBFile, mTableName, query); if (reader == null) { data[gid] = null; return(null); } if (!reader.HasRows || !reader.Read()) { data[gid] = null; reader.Close(); reader.Dispose(); return(null); } var ret = new DBDecorateItem(); ret.Gid = DBTextResource.ParseUI(GetReaderString(reader, "gid")); ret.Pos = DBTextResource.ParseUI(GetReaderString(reader, "pos_id")); ret.StrengthMax = DBTextResource.ParseUI(GetReaderString(reader, "max_lv")); ret.LvStep = DBTextResource.ParseUI(GetReaderString(reader, "lv_step")); ret.SwallowExpValue = DBTextResource.ParseUI(GetReaderString(reader, "value")); ret.Attrs = GetReaderString(reader, "attrs"); ret.LegendAttrs = DBTextResource.ParseArrayUintUint(GetReaderString(reader, "legend_attrs")); ret.DefaultExtraDesc = GetReaderString(reader, "default_extra_desc"); ret.DefaultStar = DBTextResource.ParseUI(GetReaderString(reader, "default_star")); data.Add(ret.Gid, ret); reader.Close(); reader.Dispose(); return(ret); }