Beispiel #1
0
 void OnChannelFileWatcherChanged(object sender, System.IO.FileSystemEventArgs e)
 {
     log.WriteInfo("Channel File Watcher Fired");
     Heartbeat.SendAndReceiveImmediately();
 }
Beispiel #2
0
        internal void FilterCore_ServerDispatch(object sender, NetworkMessageEventArgs e)
        {
            log.WriteDebug("Account123:" + GameRepo.Game.Account);
            if (e.Message.Type == 0xF658) // Zone Name
            {
                zonename = Convert.ToString(e.Message["zonename"]);
                log.WriteInfo("zonename123: '{0}'", zonename);
                GameRepo.Game.SetAccount(zonename);
            }

            if (e.Message.Type == 0xF7E1) // Server Name
            {
                //Server Name retrieved from the server message, not used (unreliable in EMU)
                var server = Convert.ToString(e.Message["server"]);
                log.WriteInfo("server: '{0}'", server);
                GameRepo.Game.SetServer(server);
            }

            if (e.Message.Type == 0xF658) // Character List
            {
                characterSlots = Convert.ToInt32(e.Message["slotCount"]);

                characters = new List <Character>();

                MessageStruct charactersStruct = e.Message.Struct("characters");

                bool all_chars = true;
                for (int i = 0; i < charactersStruct.Count; i++)
                {
                    int    character     = Convert.ToInt32(charactersStruct.Struct(i)["character"]);
                    string name          = Convert.ToString(charactersStruct.Struct(i)["name"]);
                    int    deleteTimeout = Convert.ToInt32(charactersStruct.Struct(i)["deleteTimeout"]);

                    characters.Add(new Character(character, name, deleteTimeout));
                    log.WriteInfo(character.ToString() + " " + name + " " + deleteTimeout.ToString());
                    if (!name.StartsWith(base_name))
                    {
                        all_chars = false;
                    }
                }

                if (characters.Count < 10 && all_chars && !creating_character)
                {
                    log.WriteDebug("Found less than 10 Ztiel characters, creating!");
                    CreateCharacter();
                }

                characters.Sort((a, b) => String.Compare(a.Name, b.Name, StringComparison.Ordinal));
            }
            if (!written)
            {
                if (GameRepo.Game.Server != "" && zonename != null && characters != null)
                {
                    CharacterBook.WriteCharacters(ServerName: GameRepo.Game.Server, zonename: zonename, characters: characters);
                    Heartbeat.LaunchHeartbeat();
                    written = true;
                }
            }
            if (CoreManager.Current.CharacterFilter.Name != characterName)
            {
                GameRepo.Game.SetCharacter(CoreManager.Current.CharacterFilter.Name);
                characterName = CoreManager.Current.CharacterFilter.Name;
            }
        }
Beispiel #3
0
 private void UnlockWindowPositionCommandHandler(string command)
 {
     Heartbeat.SendCommand(CMD_UnlockWindowPosition);
     Heartbeat.SendAndReceiveImmediately();
     Debug.WriteToChat("The window positions are unlocked, moving windows will now save their position.");
 }
Beispiel #4
0
 private void LockWindowPositionCommandHandler(string command)
 {
     Heartbeat.SendCommand(CMD_LockWindowPosition);
     Heartbeat.SendAndReceiveImmediately();
     Debug.WriteToChat("The window positions are saved and will no longer be modified.");
 }
Beispiel #5
0
 private void DisableWindowPositionCommandHandler(string command)
 {
     Heartbeat.SendCommand(CMD_DisableWindowPosition);
     Heartbeat.SendAndReceiveImmediately();
     Debug.WriteToChat("The window positions will no longer be saved or restored.");
 }
Beispiel #6
0
 private void AddLoginCmdGlobalCommandHandler(string command)
 {
     Heartbeat.SendCommand(CMD_AddLoginCmdGlobal + command);
     Heartbeat.SendAndReceiveImmediately();
 }
Beispiel #7
0
 private void KillAllClientsCommandHandler(string command)
 {
     Heartbeat.SendCommand(CMD_KillAllClients);
     Heartbeat.SendAndReceiveImmediately();
 }