public string GetStoredPlayerName(int id) { string name; StoredPlayerNames.TryGetValue(id, out name); return(name); }
public void StoreGameState() { if (MetaData.ServerInfo.GameHandle == 0) { return; } Log.Info($"Storing PowerLog for gameId={MetaData.ServerInfo.GameHandle}"); StoredPowerLogs.Add(new Tuple <uint, List <string> >(MetaData.ServerInfo.GameHandle, new List <string>(PowerLog))); if (Player.Id != -1 && !StoredPlayerNames.ContainsKey(Player.Id)) { StoredPlayerNames.Add(Player.Id, Player.Name); } if (Opponent.Id != -1 && !StoredPlayerNames.ContainsKey(Opponent.Id)) { StoredPlayerNames.Add(Opponent.Id, Opponent.Name); } if (StoredGameStats == null) { StoredGameStats = CurrentGameStats; } }
public void StoreGameState() { if (string.IsNullOrEmpty(MetaData.GameId)) { return; } Log.Info($"Storing PowerLog for gameId={MetaData.GameId}"); StoredPowerLogs.Add(new Tuple <string, List <string> >(MetaData.GameId, new List <string>(PowerLog))); if (Player.Id != -1 && !StoredPlayerNames.ContainsKey(Player.Id)) { StoredPlayerNames.Add(Player.Id, Player.Name); } if (Opponent.Id != -1 && !StoredPlayerNames.ContainsKey(Opponent.Id)) { StoredPlayerNames.Add(Opponent.Id, Opponent.Name); } if (StoredGameStats == null) { StoredGameStats = CurrentGameStats; } }
internal void ResetStoredGameState() { StoredPowerLogs.Clear(); StoredPlayerNames.Clear(); StoredGameStats = null; }
public string GetStoredPlayerName(int id) => StoredPlayerNames.TryGetValue(id, out var name) ? name : string.Empty;