public StatsUpdateList PullSurvivorStats(StatsUpdateList iList, bool iGatherFromAllPlayers) { iList.Clear(); RunReport runReport = RunReport.Generate(Run.instance, GameResultType.Unknown); List <RunReport.PlayerInfo> playerInfoList = new List <RunReport.PlayerInfo> { }; DateTime now = DateTime.Now; TimeSpan delta = now - timeStart; for (int i = 0; i < runReport.playerInfoCount; i++) { if ((iGatherFromAllPlayers) || (runReport.GetPlayerInfo(i).isLocalPlayer)) { RunReport.PlayerInfo playerInfo = runReport.GetPlayerInfo(i); ulong totalDamageDealt = playerInfo.statSheet.GetStatValueULong(StatDef.totalDamageDealt) + playerInfo.statSheet.GetStatValueULong(StatDef.totalMinionDamageDealt); // The server doesn't have access to playerInfo.networkUser.userName, playerInfo.name, or playerInfo.networkUser.GetNetworkPlayerName().GetResolvedName(); string nameIdentifier = playerInfo.bodyName; StatsUpdate update = new StatsUpdate(i + 1, nameIdentifier, delta, totalDamageDealt, playerInfo.statSheet.GetStatValueULong(StatDef.totalKills)); iList.Add(update); } } return(iList); }
public StatsUpdateList PullSurvivorStats(bool iGatherFromAllPlayers) { StatsUpdateList statsUpdateList = new StatsUpdateList { }; return(PullSurvivorStats(statsUpdateList, iGatherFromAllPlayers)); }
public StatsUpdateList PullSurvivorStats(StatsUpdateList iList, bool iGatherFromAllPlayers) { iList.Clear(); // If the server hasn't sent stats for a period of time, // assume that he doesn't have the mod installed and start tracking locally. if (StatsUpdateNetworkComponent.updateListCache.statsUpdateList.Count == 0) { client_mode_counter++; if (client_mode_counter > client_mode_counter_max) { client_mode_enabled = true; } else { return(iList); } } if (client_mode_enabled) { return(PullSurvivorStatsClientMode(iList)); } // pull it from client cache client_mode_counter = 0; client_mode_enabled = false; foreach (StatsUpdate updateA in StatsUpdateNetworkComponent.updateListCache.statsUpdateList) { iList.Add(updateA); } return(iList); }
public bool Equals(StatsUpdateList statsList) { if (statsUpdateList.Count != statsList.statsUpdateList.Count) { return(false); } int matches = statsList.statsUpdateList.Count; foreach (StatsUpdate updateA in statsUpdateList) { foreach (StatsUpdate updateB in statsList.statsUpdateList) { if (updateA == updateB) { matches--; break; } } } if (matches != 0) { return(false); } return(true); }
public void RecordUpdates(StatsUpdateList updateList) { if (updateList.statsUpdateList.Count == 0) { return; } StatsUpdateList newUpdateList = new StatsUpdateList(); foreach (StatsUpdate update in updateList.statsUpdateList) { newUpdateList.Add(update); } recorderList.Add(newUpdateList); }
public StatsUpdateList PullSurvivorStats(StatsUpdateList iList, bool iGatherFromAllPlayers) { iList.Clear(); DateTime now = DateTime.Now; DateTime then = DateTime.Now; TimeSpan span = now - then; foreach (StatsUpdate update in statsList.statsUpdateList) { StatsUpdate newUpdate = new StatsUpdate(update.player, update.identity, span, update.damageDealt, update.totalKills); iList.Add(newUpdate); } return(iList); }
public bool CompareStats(StatsUpdateList iStatsList) { return(statsList.Equals(iStatsList)); }