Beispiel #1
0
        static void Main(string[] args)
        {
            var server = new GameProxy();

            Console.WriteLine("按任意键退出...");
            Console.ReadLine();
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            var server = new GameProxy();

            Console.WriteLine("按任意键退出...");
            Console.ReadLine();
        }
Beispiel #3
0
        public GameServerConnection(string ip, int port, GameProxy proxy)
        {
            this.proxy = proxy;

            remoteEndPoint = new IPEndPoint(Dns.GetHostAddresses(ip)[0], port);
            ClientSocketSettings settings = new ClientSocketSettings(bufferSize, remoteEndPoint);

            clientSocket = new ClientSocket(settings);
            clientSocket.DataReceived += new SocketEventHandler(DataReceived);
            clientSocket.Disconnected += new SocketEventHandler(Disconnected);
        }
Beispiel #4
0
 static void Main(string[] args)
 {
     try
     {
         GameServerListManager.Initialize();
         var server = new GameProxy();
         Console.WriteLine("Press Enter to exit...");
         Console.ReadLine();
     }
     catch (Exception ex)
     {
         TraceLog.WriteError("Main error:{0}", ex);
     }
 }
Beispiel #5
0
        static void Main(string[] args)
        {
            try
            {
                GameServerListManager.Initialize();
                var server = new GameProxy();
				Console.WriteLine("Press Enter to exit...");
                Console.ReadLine();
            }
            catch (Exception ex)
			{
                TraceLog.WriteError("Main error:{0}", ex);
            }
        }
Beispiel #6
0
        public GameServerConnection(string ip, int port, GameProxy proxy)
        {
            _ssid      = Guid.NewGuid();
            this.proxy = proxy;

            remoteEndPoint = new IPEndPoint(Dns.GetHostAddresses(ip)[0], port);
            ClientSocketSettings settings = new ClientSocketSettings(bufferSize, remoteEndPoint);

            clientSocket = new ClientSocket(settings);
            clientSocket.DataReceived += new SocketEventHandler(DataReceived);
            clientSocket.Disconnected += new SocketEventHandler(Disconnected);
            EnsureConnected();
            _timer = new Timer(DoCheckHeartbeat, null, 1000, 30 * 1000); //30s
        }
Beispiel #7
0
 static void Main(string[] args)
 {
     Logger Logger = LogManager.GetLogger("ProxyServer");
     try
     {
         var g = GameServerListManager.Current;
         var server = new GameProxy();
         Console.WriteLine("Press Enter to exit...");
         Console.ReadLine();
     }
     catch (Exception ex)
     {
         Logger.Error("{0} error:{1}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), ex);
     }
 }
Beispiel #8
0
 static void Main(string[] args)
 {
     try
     {
         var dict = new CacheList <int>();
         dict.Add(1);
         string js   = dict.ToJson();
         var    temp = js.ParseJson <CacheList <int> >();
         if (temp == null)
         {
         }
         GameServerListManager.Initialize();
         var server = new GameProxy();
         Console.WriteLine("Press Enter to exit...");
         Console.ReadLine();
     }
     catch (Exception ex)
     {
         TraceLog.WriteError("Main error:{0}", ex);
     }
 }
Beispiel #9
0
        static void Main(string[] args)
        {
            try
            {
                var dict = new CacheList<int>();
                dict.Add(1);
                string js = dict.ToJson();
                var temp = js.ParseJson<CacheList<int>>();
                if(temp == null)
                {

                }
                GameServerListManager.Initialize();
                var server = new GameProxy();
                Console.WriteLine("Press Enter to exit...");
                Console.ReadLine();
            }
            catch (Exception ex)
            {
                TraceLog.WriteError("Main error:{0}", ex);
            }
        }
Beispiel #10
0
 public GSConnectionManager(GameProxy proxy)
 {
     this.proxy = proxy;
 }
Beispiel #11
0
        public GameServerConnection(string ip, int port, GameProxy proxy)
        {
            this.proxy = proxy;

            remoteEndPoint = new IPEndPoint(Dns.GetHostAddresses(ip)[0], port);
            ClientSocketSettings settings = new ClientSocketSettings(bufferSize, remoteEndPoint);
            clientSocket = new ClientSocket(settings);
            clientSocket.DataReceived += new SocketEventHandler(DataReceived);
            clientSocket.Disconnected += new SocketEventHandler(Disconnected);
        }
Beispiel #12
0
 public GSConnectionManager(GameProxy proxy)
 {
     this.proxy = proxy;
 }
Beispiel #13
0
 public GSConnectionManager(GameProxy proxy)
 {
     this.proxy = proxy;
     _timer = new Timer(DoRefreshGameServer, null, 60000, _dueRefleshTime);
 }
Beispiel #14
0
        public GameServerConnection(string ip, int port, GameProxy proxy)
        {
            _ssid = Guid.NewGuid();
            this.proxy = proxy;

            remoteEndPoint = new IPEndPoint(Dns.GetHostAddresses(ip)[0], port);
            ClientSocketSettings settings = new ClientSocketSettings(bufferSize, remoteEndPoint);
            clientSocket = new ClientSocket(settings);
            clientSocket.DataReceived += new SocketEventHandler(DataReceived);
            clientSocket.Disconnected += new SocketEventHandler(Disconnected);
            EnsureConnected();

            _timer = new Timer(DoCheckHeartbeat, null, 1000, 30 * 1000); //30s
        }
Beispiel #15
0
 public GSConnectionManager(GameProxy proxy)
 {
     this.proxy = proxy;
     _timer     = new Timer(DoRefreshGameServer, null, 60000, _dueRefleshTime);
 }