public static bool GetMyMazeRank(this IDatabase db, fmRankerKey myRankKey, out long myRank) { myRank = 0; string key = new JavaScriptSerializer().Serialize(myRankKey); var ranking = db.SortedSetRank(GetKeyMazeRank(), key, order: Order.Descending); if (null != ranking) { myRank = (long)ranking + 1; } return(true); }
public static bool SetMazeRank(this IDatabase db, fmRankerKey frk, int floor) { string strValue = new JavaScriptSerializer().Serialize(frk); return(db.SortedSetAdd(GetKeyMazeRank(), strValue, floor)); }