public void StoreUser(MiunieUser user) { if (_persistentStorage.Exists <MiunieUser>(u => u.UserId == user.UserId && u.GuildId == user.GuildId)) { _persistentStorage.Update(user); } else { _persistentStorage.Store(user); } }
public static void StoreUser(UserAccount user) { if (_persistentStorage.Exists(user.ID)) { _persistentStorage.Update(user); } else { _persistentStorage.Store(user); } foreach (var lb in leaderBoards.Values) { lb.Set(user); } }
public string GetDataBasePath(bool isGlobal, string dbName) { if (dbName == MemoryDB) { return(dbName); } string dbPath = dbName; if (!Path.IsPathRooted(dbName)) { dbPath = Path.Combine(isGlobal || string.IsNullOrEmpty(ServerID) ? DataPath : Path.Combine(DataPath, ServerID), dbName); } if (!Storage.Exists(dbPath)) { ZibaobaoLibContext.Instance.IsFirstTimeStart = true; Storage.Create(dbPath); } return(dbPath); }