public Game(string hostname, int port, string username, string password, LogLevel logLevel) { UI = new T(); UI.Game = this; UI.LogLevel = logLevel; World = new GameWorld(); this.Username = username; socket = new AuthSocket(this, hostname, port, username, password); socket.InitHandlers(); }
public AutomatedGame(string hostname, int port, string username, string password, int realmId, int character) { this.RealmID = realmId; this.Character = character; scheduledActions = new ScheduledActions(); World = new GameWorld(); this.Hostname = hostname; this.Port = port; this.Username = username; this.Password = password; socket = new AuthSocket(this, Hostname, Port, Username, Password); socket.InitHandlers(); }
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 AutomatedGame(string hostname, int port, string username, string password, int realmId, int character) { this.RealmID = realmId; this.Character = character; scheduledActions = new ScheduledActions(); updateObjectHandler = new UpdateObjectHandler(this); Triggers = new IteratedList <Trigger>(); World = new GameWorld(); Player = new Player(); Player.OnFieldUpdated += OnFieldUpdate; Objects = new Dictionary <ulong, WorldObject>(); CompletedAchievements = new HashSet <uint>(); AchievementCriterias = new Dictionary <uint, ulong>(); this.Hostname = hostname; this.Port = port; this.Username = username; this.Password = password; socket = new AuthSocket(this, Hostname, Port, Username, Password); socket.InitHandlers(); }
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(); }
public AutomatedGame(string hostname, int port, string username, string password, int realmId, int character) { this.RealmID = realmId; this.Character = character; scheduledActions = new ScheduledActions(); updateObjectHandler = new UpdateObjectHandler(this); Triggers = new IteratedList<Trigger>(); World = new GameWorld(); Player = new Player(); Player.OnFieldUpdated += OnFieldUpdate; Objects = new Dictionary<ulong, WorldObject>(); CompletedAchievements = new HashSet<uint>(); AchievementCriterias = new Dictionary<uint, ulong>(); AIs = new Stack<IGameAI>(); PushAI(new EmptyAI()); this.Hostname = hostname; this.Port = port; this.Username = username; this.Password = password; socket = new AuthSocket(this, Hostname, Port, Username, Password); socket.InitHandlers(); }
public AutomatedGame(string hostname, int port, string username, string password, int realmId, int character) { this.RealmID = realmId; this.Character = character; scheduledActions = new ScheduledActions(); updateObjectHandler = new UpdateObjectHandler(this); Triggers = new List<Trigger>(); World = new GameWorld(); Player = new Player(); Player.OnFieldUpdated += OnFieldUpdate; Objects = new Dictionary<ulong, WorldObject>(); this.Hostname = hostname; this.Port = port; this.Username = username; this.Password = password; socket = new AuthSocket(this, Hostname, Port, Username, Password); socket.InitHandlers(); }