private static void UpdateState(Frags packetData)
 {
     Program.State.Servers.AddOrUpdate(packetData.Port,
                                       new Server()
     {
         Port      = packetData.Port,
         IsStarted = packetData.IsStarted,
         GameType  = GetGameType(packetData.GameType)
     },
                                       (port, server) =>
     {
         server.IsStarted = packetData.IsStarted;
         server.GameType  = GetGameType(packetData.GameType);
         for (int i = 0; i < server.CurrentPlayers; i++)
         {
             server.Players[i].Score = packetData.Scores[i];
         }
         return(server);
     });
 }
        private static void ProcessFragsPacket(byte[] buffer)
        {
            int       port       = BitConverter.ToInt32(buffer, 4);
            int       gameType   = BitConverter.ToInt32(buffer, 8);
            const int maxPlayers = 8;

            int[] scores = new int[maxPlayers];
            for (int i = 0; i < scores.Length; i++)
            {
                scores[i] = BitConverter.ToInt32(buffer, 12 + i * sizeof(int));
            }

            var packetData = new Frags()
            {
                Port     = port,
                GameType = gameType,
                Scores   = scores
            };

            UpdateState(packetData);
        }