private void CloseClient()
        {
            players.ForEach((player) => {
                player.joinedMatch = null;
            });

            socket.Close();
            availablePorts.Add(port);
            ServerTCP.OnMatchStop(this);

            if (!process.HasExited)
            {
                process.Kill();
            }

            Console.WriteLine("Connection from match {0} has been terminated.", index);
        }
Example #2
0
        private static void HandleMatchServerStarted(int index, byte[] data)
        {
            Console.WriteLine("Match {0} has readied its server.", index);

            ServerTCP.OnMatchServerReady(index);
        }
Example #3
0
 static void Main(string[] args)
 {
     ServerHandleNetworkData.InitializeNetworkPackages();
     ServerTCP.SetupServer();
     Console.ReadLine();
 }
Example #4
0
        private static void HandleFindMatch(int index, byte[] data)
        {
            Console.WriteLine("Player {0} requested to find match.", index);

            ServerTCP.AddToQueue(index);
        }