public static bool GetMissionBase(this IDatabase db, long accid, out fmMissionBase obj) { obj = null; string strValue = db.StringGet(GetKeyLordMissionBase(accid)); if (true == string.IsNullOrEmpty(strValue)) { obj = new fmMissionBase { RefreshCnt = 3, MissionTime = fmServerTime.Epoch, }; return(true); } obj = new JavaScriptSerializer().Deserialize <fmMissionBase>(strValue); if (null == obj) { obj = new fmMissionBase { RefreshCnt = 3, MissionTime = fmServerTime.Epoch, } } ; return(true); }
public static void SetMissionBase(this ITransaction trans, long accid, fmMissionBase dataObj) { string strValue = new JavaScriptSerializer().Serialize(dataObj); trans.StringSetAsync(GetKeyLordMissionBase(accid), strValue); }
public static bool SetMissionBase(this IDatabase db, long accid, fmMissionBase dataObj) { string strValue = new JavaScriptSerializer().Serialize(dataObj); return(db.StringSet(GetKeyLordMissionBase(accid), strValue)); }