コード例 #1
0
ファイル: Game.cs プロジェクト: thelextor/BotFarm
        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();
        }
コード例 #2
0
ファイル: AutomatedGame.cs プロジェクト: vanasisf/BotFarm
        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();
        }
コード例 #3
0
ファイル: AutomatedGame.cs プロジェクト: vanasisf/BotFarm
        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 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();
        }
コード例 #6
0
ファイル: AutomatedGame.cs プロジェクト: Kittnz/BotFarm
        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);
            }
        }
コード例 #7
0
ファイル: AutomatedGame.cs プロジェクト: Kittnz/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();
                Connected = true;
            }
            else
                Reconnect();
        }
コード例 #8
0
ファイル: AutomatedGame.cs プロジェクト: Kittnz/BotFarm
        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();
        }
コード例 #9
0
ファイル: AutomatedGame.cs プロジェクト: greeld/BotFarm
        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();
        }