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(); }
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); } }); }
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); } }
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(); } }
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); } }
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(); }