Beispiel #1
0
        private void SetClient(GameClient client)
        {
            Game     = client;
            AI       = null;
            MiningAI = null;
            Stop();

            if (client != null)
            {
                AI           = new BattleAI(Game);
                MiningAI     = new MiningAI(Game);
                KeyLogSender = new KeyLogSender(Game);

                MiningAI.LogMessage            += PrintLogMessage;
                client.LogMessage              += PrintLogMessage;
                client.ConnectionOpened        += Client_ConnectionOpened;
                client.ConnectionFailed        += Client_ConnectionFailed;
                client.ConnectionClosed        += Client_ConnectionClosed;
                client.WebSuccessfullyLoggedIn += Client_WebSuccessfullyLoggedIn;
                client.TeleportationOccuring   += Client_TeleportationOccuring;
                client.BattleMessage           += Client_BattleMessage;
                client.LoggingError            += Client_LoggingError;
                client.SystemMessage           += Client_SystemMessage;
                client.SmartFoxApiOk           += Client_SmartFoxApiOk;
            }
            ClientChanged?.Invoke();
        }
Beispiel #2
0
        private void SetClient(GameClient client)
        {
            Game     = client;
            AI       = null;
            MiningAI = null;
            Stop();

            if (client != null)
            {
                Game.Timer                    = DateTime.Now;
                AI                            = new BattleAI(Game);
                MiningAI                      = new MiningAI(Game);
                client.LogMessage            += PrintLogMessage;
                client.Connected             += Game_Connected;
                client.Disconnected          += Game_Disconnected;
                client.TeleportationOccuring += client_TeleportationOccuring;
                client.BattleMessage         += Client_BattleMessage;
                client.LoggingError          += Client_LoggingError;
                client.SystemMessage         += Client_SystemMessage;
            }
            ClientChanged?.Invoke();
        }