Exemple #1
0
        public void LoadCharacterListFromThwargFilterData(Server server, ThwargFilter.ServerCharacterListByAccount charlist)
        {
            server.AvailableCharacters.Clear();
            //create and add a default character of none.
            var defaultChar = new AccountCharacter()
            {
                Id   = 0,
                Name = "None"
            };

            server.AvailableCharacters.Add(defaultChar);

            if (charlist != null)
            {
                List <ThwargFilter.Character> filterChars = charlist.CharacterList;
                if (filterChars != null)
                {
                    foreach (var dllChar in filterChars)
                    {
                        var acctChar = new AccountCharacter()
                        {
                            Id   = 99, // TODO - not used
                            Name = dllChar.Name
                        };
                        server.AvailableCharacters.Add(acctChar);
                    }
                }
            }
        }
Exemple #2
0
        private void InitializeMe(ThwargFilter.CharacterBook characterBook)
        {
            foreach (var serverItem in ServerManager.ServerList)
            {
                //TODO: Actual Server Selection
                //if (!IsServerEnabled(serverName)) { continue; }
                // Get characters from dll
                ThwargFilter.ServerCharacterListByAccount charlist = null;
                if (characterBook != null)
                {
                    charlist = characterBook.GetCharacters(serverName: serverItem.ServerName, accountName: this.Name);
                }
                // Construct server & character data
                var server = new Server(this, serverItem);

                server.ChosenCharacter = "None";

                LoadCharacterListFromThwargFilterData(server, charlist);
                if (charlist != null)
                {
                    this.ZoneId = charlist.ZoneId; // recording this each time through this loop, but it will be the same so that is okay
                }
                server.PropertyChanged += ServerPropertyChanged;
                // Record data
                _servers.Add(server);
            }
        }