private void AddPlayer(StringBuilder name, int?ping, int deaths, int kills, byte id, MyMwcObjectBuilder_FactionEnum faction, bool isFaction = false)
        {
            if (faction == MyMwcObjectBuilder_FactionEnum.None) // Dont add players without factions
            {
                return;
            }

            if (!m_statsTableFactions.ContainsKey(faction))
            {
                m_statsTableFactions.Add(faction, new MyFactionStats(faction));
            }
            if (!isFaction)
            {
                m_statsTableFactions[faction] = new MyFactionStats(faction, m_statsTableFactions[faction].Kills + kills, m_statsTableFactions[faction].Deaths + deaths);
            }
            m_stats.Add(new MyStatsRow()
            {
                Name      = isFaction? name : new StringBuilder("    ").Append(name),
                Ping      = ping,
                Deaths    = deaths,
                Kills     = kills,
                Id        = id,
                Faction   = faction,
                IsFaction = isFaction
            });
        }
예제 #2
0
        private void AddPlayer(StringBuilder name, int? ping, int deaths, int kills, byte id, MyMwcObjectBuilder_FactionEnum faction, bool isFaction = false){
            if (faction == MyMwcObjectBuilder_FactionEnum.None) // Dont add players without factions
                return;

            if (!m_statsTableFactions.ContainsKey(faction))
            {
                m_statsTableFactions.Add(faction, new MyFactionStats(faction));
            }
            if (!isFaction)
            {
                m_statsTableFactions[faction] = new MyFactionStats(faction, m_statsTableFactions[faction].Kills+kills, m_statsTableFactions[faction].Deaths+deaths);
            }
            m_stats.Add(new MyStatsRow()
            {
                Name = isFaction? name : new StringBuilder("    ").Append(name),
                Ping = ping,
                Deaths = deaths,
                Kills = kills,
                Id = id,
                Faction = faction,
                IsFaction = isFaction
            });
        }