public override void OnEvent(PlayerAllStats evnt)
 {
     if (evnt.TargetPlayerID == SWMatchmaking.GetMyBoltId())
     {
         var entry = CreateEntryForPlayer(evnt.PlayerID, evnt.Name, evnt.Team.ToTeam());
         if (entry)
         {
             entry.UpdateKillCount(evnt.KillCount);
             entry.UpdateDeathCount(evnt.DeathCount);
         }
     }
 }
Пример #2
0
        // PRIVATE

        private void SendStatsToPlayer(int playerID)
        {
            foreach (var playerStat in AllPlayersStats)
            {
                PlayerAllStats playerAllStats = PlayerAllStats.Create();
                playerAllStats.Name           = playerStat.Value.Name;
                playerAllStats.Team           = (int)playerStat.Value.Team;
                playerAllStats.TargetPlayerID = playerID;
                playerAllStats.PlayerID       = playerStat.Key;
                playerAllStats.KillCount      = playerStat.Value.KillCount;
                playerAllStats.DeathCount     = playerStat.Value.DeathCount;
                playerAllStats.Send();
            }
        }