Esempio n. 1
0
        public void StopGame()
        {
            lock (GameStateLock)
            {
                GameState = GameStates.Aborted;
            }
            CloseTimer.Restart();

            Logger.GameLog("This was the final point");
            Logger.GameLog("Final Score: Team Red: " + GameStructure.GameTeams[0].score.ToString() + "\tTeam Blue: " + GameStructure.GameTeams[1].score.ToString());
            Logger.GameLog("Game finished");
            Logger.GameLog("Sending final Game finished to the Clients");
            BroadcastGameFinishedPackage();
            Logger.GameLog("Game Finished Package has been sent waiting " + TeardownDelaySeconds.ToString() + " seconds before tearing down the network");
        }
Esempio n. 2
0
        public void Update()
        {
            Matchmaking.FindMatches();

            CombineConnectionsWithMatches();

            foreach (NetworkConnection connection in m_waitingClientConnections.Entries)
            {
                if (!connection.Connected)
                {
                    RemoveClientFromQueue(connection);
                }
            }

            if (UpdateMatchmakingQueue == true)
            {
                BroadcastMatchmakingStatus();
                UpdateMatchmakingQueue.Restart();
            }

            m_waitingClientConnections.TrimExcess();    // Helps debugging Memory Leaks
        }