예제 #1
0
파일: Game.cs 프로젝트: thelextor/BotFarm
        public void Start()
        {
            // the initial socket is an AuthSocket - it will initiate its own asynch read
            Running = socket.Connect();

            while (Running)
            {
                // main loop here
                UI.Update();
                Thread.Sleep(100);
            }

            UI.Exit();
        }
예제 #2
0
        public virtual void Start()
        {
            // the initial socket is an AuthSocket - it will initiate its own asynch read
            Running = socket.Connect();

            Task.Run(async() =>
            {
                while (Running)
                {
                    // main loop here
                    Update();
                    await Task.Delay(100);
                }
            });
        }
예제 #3
0
        public void Reconnect()
        {
            Connected = false;
            LoggedIn  = false;
            while (Running)
            {
                socket.Disconnect();
                scheduledActions.Clear();
                socket = new AuthSocket(this, Hostname, Port, Username, Password);
                socket.InitHandlers();
                // exit from loop if the socket connected successfully
                if (socket.Connect())
                {
                    break;
                }

                // try again later
                Thread.Sleep(10000);
            }
        }
예제 #4
0
파일: Game.cs 프로젝트: thelextor/BotFarm
        public void ConnectTo(WorldServerInfo server)
        {
            if (socket is AuthSocket)
            {
                Key = ((AuthSocket)socket).Key;
            }

            socket.Dispose();

            socket = new WorldSocket(this, server);
            socket.InitHandlers();

            if (socket.Connect())
            {
                socket.Start();
            }
            else
            {
                Exit().Wait();
            }
        }
예제 #5
0
        public void Reconnect()
        {
            Connected = false;
            LoggedIn = false;
            while (Running)
            {
                socket.Disconnect();
                scheduledActions.Clear();
                ResetTriggers();
                socket = new AuthSocket(this, Hostname, Port, Username, Password);
                socket.InitHandlers();
                // exit from loop if the socket connected successfully
                if (socket.Connect())
                    break;

                // try again later
                Thread.Sleep(10000);
            }
        }
예제 #6
0
        public void ConnectTo(WorldServerInfo server)
        {
            if (socket is AuthSocket)
                Key = ((AuthSocket)socket).Key;

            socket.Dispose();

            socket = new WorldSocket(this, server);
            socket.InitHandlers();

            if (socket.Connect())
            {
                socket.Start();
                Connected = true;
            }
            else
                Reconnect();
        }