Пример #1
0
        static void Main(string[] args)
        {
            var server = new GameProxy();

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

            Console.WriteLine("按任意键退出...");
            Console.ReadLine();
        }
Пример #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);
        }
Пример #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);
     }
 }
Пример #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);
            }
        }
Пример #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
        }
Пример #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);
     }
 }
Пример #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);
     }
 }
Пример #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);
            }
        }
Пример #10
0
 public GSConnectionManager(GameProxy proxy)
 {
     this.proxy = proxy;
 }
Пример #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);
        }
Пример #12
0
 public GSConnectionManager(GameProxy proxy)
 {
     this.proxy = proxy;
 }
Пример #13
0
 public GSConnectionManager(GameProxy proxy)
 {
     this.proxy = proxy;
     _timer = new Timer(DoRefreshGameServer, null, 60000, _dueRefleshTime);
 }
Пример #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
        }
Пример #15
0
 public GSConnectionManager(GameProxy proxy)
 {
     this.proxy = proxy;
     _timer     = new Timer(DoRefreshGameServer, null, 60000, _dueRefleshTime);
 }