Exemple #1
0
        private static void StartGateway(int KOGatewayPort, string GameServerIPAddress, int GameServerPort)
        {
            bool Whiles = false;

            GatewayPort = KOGatewayPort;

            KnightOnlineGateway.GameServerIPAddress = IPAddress.Parse(GameServerIPAddress);

            KnightOnlineGateway.GameServerPort = GameServerPort;

            try
            {
                TLGeneral = new TcpListener(IPAddress.Any, GatewayPort);
                TLGeneral.Start();

                WriteConsoleWithColor("Knight Online Gateway Başladı...", ConsoleColor.FOREGROUND_YESIL);

                Whiles = true;
            }

            catch
            {
                WriteConsoleWithColor("Game Server Bağlantısı Sağlanılamadı, Knight Online Gateway Başlatılamadı..!", ConsoleColor.FOREGROUND_ACIKKIRMIZI);

                Whiles = false;
            }

            WriteConsoleWithColor("Knight Online Gateway Port : " + GatewayPort.ToString(), ConsoleColor.FOREGROUND_ACIKBEYAZ);
            WriteConsoleWithColor("IP Address : " + GameServerIPAddress, ConsoleColor.FOREGROUND_ACIKBEYAZ);
            WriteConsoleWithColor("Game Server Port : " + GameServerPort, ConsoleColor.FOREGROUND_ACIKBEYAZ);

            if (Whiles)
            {
                while (true)
                {
                    Socket XSocket            = TLGeneral.AcceptSocket();
                    KnightOnlineGateway GSync = new KnightOnlineGateway(XSocket);
                    Thread ThreadSync         = new Thread(new ThreadStart(GSync.RunWorkerSync));
                    ThreadSync.Start();
                }
            }
        }
        private static void StartGateway(int KOGatewayPort, string GameServerIPAddress, int GameServerPort)
        {
            bool Whiles = false;

            GatewayPort = KOGatewayPort;

            KnightOnlineGateway.GameServerIPAddress = IPAddress.Parse(GameServerIPAddress);

            KnightOnlineGateway.GameServerPort = GameServerPort;

            try
            {

                TLGeneral = new TcpListener(IPAddress.Any, GatewayPort);
                TLGeneral.Start();

                WriteConsoleWithColor("Knight Online Gateway Başladı...", ConsoleColor.FOREGROUND_YESIL);

                Whiles = true;

            }

            catch
            {
                WriteConsoleWithColor("Game Server Bağlantısı Sağlanılamadı, Knight Online Gateway Başlatılamadı..!", ConsoleColor.FOREGROUND_ACIKKIRMIZI);

                Whiles = false;
            }

            WriteConsoleWithColor("Knight Online Gateway Port : " + GatewayPort.ToString(), ConsoleColor.FOREGROUND_ACIKBEYAZ);
            WriteConsoleWithColor("IP Address : " + GameServerIPAddress, ConsoleColor.FOREGROUND_ACIKBEYAZ);
            WriteConsoleWithColor("Game Server Port : " + GameServerPort, ConsoleColor.FOREGROUND_ACIKBEYAZ);

            if (Whiles)
            {
                while (true)
                {
                    Socket XSocket = TLGeneral.AcceptSocket();
                    KnightOnlineGateway GSync = new KnightOnlineGateway(XSocket);
                    Thread ThreadSync = new Thread(new ThreadStart(GSync.RunWorkerSync));
                    ThreadSync.Start();
                }
            }
        }