public static void SetLoginCommands(string accountName, string serverName, string characterName, string text, int waitTimeMs)
        {
            var persister = new LoginCommandPersister(accountName: accountName, serverName: serverName, characterName: characterName);
            var cmds      = ParseCommandsFromText(text);

            persister.WriteQueue(cmds, global: false);
        }
        public static void SetGlobalLoginCommands(string text, int waitTimeMs)
        {
            var persister = new LoginCommandPersister();
            var cmds      = ParseCommandsFromText(text);

            persister.WriteQueue(cmds, global: true);
        }
        public static LoginCommands GetLoginCommands(string accountName, string serverName, string characterName)
        {
            var persister = new LoginCommandPersister(accountName: accountName, serverName: serverName, characterName: characterName);
            var cmds      = persister.ReadQueue(global: false);

            return(cmds);
        }
        public static LoginCommands GetGlobalLoginCommands()
        {
            var persister = new LoginCommandPersister();
            var cmds      = persister.ReadQueue(global: true);

            return(cmds);
        }
        public void FilterCore_CommandLineText(object sender, ChatParserInterceptEventArgs e)
        {
            bool   writeChanges = true;
            bool   global       = false;
            string cmdtext      = e.Text;

            if (cmdtext.Contains("/tfglobal"))
            {
                cmdtext = cmdtext.Replace(" /tfglobal", " /tf");
                cmdtext = cmdtext.Replace("/tfglobal ", "/tf ");
                cmdtext = cmdtext.Replace("/tfglobal", "/tf");
                global  = true;
            }
            if (cmdtext.StartsWith("/tf log "))
            {
                string logmsg = TextRemainder(cmdtext, "/tf log ");
                log.WriteInfo(logmsg);

                e.Eat = true;
            }
            if (e.Eat && writeChanges)
            {
                var persister = new LoginCommandPersister(GameRepo.Game.Account, GameRepo.Game.Server, GameRepo.Game.Character);
            }
        }
        public void FilterCore_ClientDispatch(object sender, NetworkMessageEventArgs e)
        {
            if (e.Message.Type == 0xF7C8)
            { // Enter Game
                freshLogin    = true;
                current_state = STEELBOT_STATE.HELLO;
                steelRunnerTimer_initialized = false;
            }

            if (e.Message.Type == 0xF7B1 && Convert.ToInt32(e.Message["action"]) == 0xA1) // Character Materialize (Any time is done portalling in, login or portal)
            {
                if (freshLogin)
                {
                    freshLogin       = false;
                    current_state    = STEELBOT_STATE.HELLO;
                    action_completed = true;

                    string characterName = GameRepo.Game.Character;
                    if (string.IsNullOrEmpty(characterName))
                    {
                        // Do not know why GameRepo.Game.Character is not yet populated, but it isn't
                        var launchInfo = LaunchControl.GetLaunchInfo();
                        if (launchInfo.IsValid)
                        {
                            characterName = launchInfo.CharacterName;
                        }
                    }

                    var persister = new LoginCommandPersister(GameRepo.Game.Account, GameRepo.Game.Server, characterName);

                    log.WriteDebug("FilterCore_ClientDispatch: Character: '{0}'", GameRepo.Game.Character);

                    //_loginCmds = persister.ReadAndCombineQueues();

                    loginCompleteTime = DateTime.Now;

                    initHandlers();

                    CoreManager.Current.RenderFrame += new EventHandler <EventArgs>(Current_RenderFrame);
                }
                else
                {
                    // find the pathwarden
                    current_state    = STEELBOT_STATE.MOVING_TO_CHEST;
                    action_completed = true;
                }
            }
        }