예제 #1
0
        public static void BackButton_MouseUp(object sender, EventArgs e)
        {
            if (EngineMessageBox.Visible || Common.Configuration.Disconnected)
            {
                return;
            }

            EngineMultimedia.Play(EngineSoundEnum.Click);

            LoginServerPacket.BackToLogin();
            NetworkSocket.DiscoverServer(NetworkSocketEnum.GameServer);

            WindowLogin.TextBox[0].CursorEnabled = true;
            WindowLogin.TextBox[1].CursorEnabled = false;
            WindowLogin.TextBox[0].Clear();
            WindowLogin.TextBox[1].Clear();

            Common.Configuration.HexID = string.Empty;

            EngineCore.GameState = 1;
        }
예제 #2
0
        static public void Update()
        {
            NetworkSocket.ReceiveData();

            if (Environment.TickCount >= tcpTick + 1000)
            {
                if (!Common.Configuration.Disconnected)
                {
                    NetworkSocket.DiscoverServer(NetworkSocketEnum.LoginServer);
                    NetworkSocket.DiscoverServer(NetworkSocketEnum.WorldServer);
                    NetworkSocket.DiscoverServer(NetworkSocketEnum.GameServer);
                }

                tcpTick = Environment.TickCount;
            }

            //ping
            if (GameState == 6)
            {
                if (Environment.TickCount >= pingTick + 1000)
                {
                    CommonPacket.RequestPing();
                    pingTick = Environment.TickCount;
                }
            }

            if (Environment.TickCount >= tickFPS + 1000)
            {
                FPS  = pFPS;
                pFPS = 0;

                tickFPS = Environment.TickCount;
            }
            else
            {
                pFPS++;
            }
        }