Пример #1
0
        static void Main(string[] args)
        {
            SetUpLogging();

            ClientServer cServer = new ClientServer(Log); // handles communication with clients through websocket protocol
            GameServer gServer = new GameServer(Log); //handles communication with servants through TCP
            Console.WriteLine("Proxy up and running. Type 'exit' to terminate it.");
            LogConfigFile = "Proxy.config";
            LoggerName = "Proxy.Log";
            string RoundTripLogName = Properties.Settings.Default.log_roundtrip;

            String RoundtripLog = "Client\tRoundTrip\tTimeToProcess\tLatePackets\tPackets\n";
            using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\Temp\" + RoundTripLogName, true))
            {
                file.Write(RoundtripLog);
            }

            string Command = string.Empty;
            while (Command != "exit")
            {
                Command = Console.ReadLine();
            }

            cServer.Stop();
            gServer.Stop();
        }
Пример #2
0
 /// <summary>
 /// create a ServerContext using a tcpclient tc and tied to the proxy's gameserver gs
 /// </summary>
 /// <param name="gs"></param>
 /// <param name="tc"></param>
 /// <param name="ep"></param>
 public ServerContext(GameServer gs, TcpClient tc)
 {
     this.gameServer = gs;
     this.serverConnection = tc;
     this.ClientAddress = this.serverConnection.Client.RemoteEndPoint;
 }