コード例 #1
0
        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);
        }
コード例 #2
0
        public StatsUpdateList PullSurvivorStats(bool iGatherFromAllPlayers)
        {
            StatsUpdateList statsUpdateList = new StatsUpdateList {
            };

            return(PullSurvivorStats(statsUpdateList, iGatherFromAllPlayers));
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
        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);
        }
コード例 #6
0
        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);
        }
コード例 #7
0
 public bool CompareStats(StatsUpdateList iStatsList)
 {
     return(statsList.Equals(iStatsList));
 }