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);
        }
Esempio n. 5
0
        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);
                persister.WriteQueue(_loginCmds, global);
            }
        }
Esempio n. 6
0
        public void FilterCore_ClientDispatch(object sender, NetworkMessageEventArgs e)
        {
            if (e.Message.Type == 0xF7C8) // Enter Game
            {
                freshLogin = true;
            }

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

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

                if (_loginCmds.Commands.Count > 0)
                {
                    loginCompleteTime = DateTime.Now;

                    sendingLastEnter = false;
                    CoreManager.Current.RenderFrame += new EventHandler <EventArgs>(Current_RenderFrame);
                }
            }
        }