Esempio n. 1
0
        public override void ReadMessage(PacketReader stream)
        {
            if (!TDMMode.IsActive)
            {
                return;
            }

            UpdateScenario();

            int teamCount = stream.ReadByte();

            for (int t = 0; t < teamCount; t++)
            {
                if (t >= BoardCount)
                {
                    return;
                }

                ScoreBoard board = Boards[t];
                board.Reset();

                int teamScore = stream.ReadShort();
                board.SetTitle(string.Format("{0} ({1}/{2})", activeScenario.Teams[t].Name, teamScore, TDMMode.ScoreLimit));

                board.ReadEntries(stream, false);
            }

            int spectators = stream.ReadByte();

            for (int i = 0; i < spectators; i++)
            {
                var lowest = Boards.Aggregate((c1, c2) => c1.EntryCount < c2.EntryCount ? c1 : c2);
                lowest.AddEntry(new ScoreBoard.Entry(stream), true);
            }
        }