public ViewModelWindowSocial() { var currentCharacterName = Client.Characters.CurrentPlayerCharacter?.Name; var onlinePlayers = OnlinePlayersSystem.ClientEnumerateOnlinePlayers(); //// uncomment to test long fake users list //{ // onlinePlayers = new List<string>() // { "Test1", "Test2", "Test33333333333333333333", "Test444444", "Test5" }; // for (var i = 0; i < 2; i++) // { // onlinePlayers = onlinePlayers.Concat(onlinePlayers.ToList()); // } //} var list = onlinePlayers .ExceptOne(currentCharacterName) .Select(name => new ViewModelPlayer(name)) .ToList(); list.Sort(); this.PlayersOnline = new SuperObservableCollection <ViewModelPlayer>(list); OnlinePlayersSystem.ClientOnPlayerAddedOrRemoved += this.OnPlayerAddedOrRemovedHandler; OnlinePlayersSystem.ClientTotalServerPlayersCountChanged += this.TotalServerPlayersCountChangedHandler; ClientChatBlockList.CharacterBlockStatusChanged += this.CharacterBlockStatusChangedHandler; }
public ViewModelPartyMember( string name, BaseCommand commandRemove, Visibility removeButtonVisibility) { this.Name = name; this.CommandRemove = commandRemove; this.RemoveButtonVisibility = removeButtonVisibility; this.IsOnline = name == ClientCurrentCharacterHelper.Character.Name || OnlinePlayersSystem.ClientIsOnline(name); OnlinePlayersSystem.ClientPlayerAddedOrRemoved += this.OnlinePlayersSystemPlayerAddedOrRemovedHandler; }