private bool doesSnapshotContainUsers(LobbyMembersSnapshot snapshot, IEnumerable <string> userNames)
 {
     return(snapshot.LobbyMembers
            .Select(member => member.UserName)
            .OrderBy(name => name)
            .SequenceEqual(userNames.OrderBy(name => name)));
 }
Beispiel #2
0
        private void sendMembersSnapshot(ILobbyMember excludedMember = null)
        {
            var LobbyMembersSnapshot = new LobbyMembersSnapshot
            {
                LobbyMembers = connectedPlayers.Select(player => player.User).ToArray()
            };

            sendMessage(player => player.SendLobbyMembersSnapshot(LobbyMembersSnapshot), excludedMember);
        }
 public void SendLobbyMembersSnapshot(LobbyMembersSnapshot lobbySnapshot)
 {
     lock (syncObject)
     {
         if (lobby != null)
         {
             var players = lobbySnapshot.ToViewModel();
             Application.Current.Dispatcher.InvokeAsync(() => lobby.SendLobbyMembersSnapshot(players));
         }
     }
 }
 public void SendLobbyMembersSnapshot(LobbyMembersSnapshot lobbyMembersSnapshot)
 {
     try
     {
         log("is sent LobbyMembersSnapshot");
         callback.SendLobbyMembersSnapshot(lobbyMembersSnapshot);
     }
     catch (Exception ex)
     {
         logError("sending LobbyMembersSnapshot", ex);
     }
 }
Beispiel #5
0
 public void SendLobbyMembersSnapshot(LobbyMembersSnapshot lobbySnapshot)
 {
     Console.WriteLine($"Members: {string.Join(" ", lobbySnapshot.LobbyMembers.Select(member => member.UserName))}");
 }
Beispiel #6
0
 public void SendLobbyMembersSnapshot(LobbyMembersSnapshot lobbyMembersSnapshot)
 {
     session.SendLobbyMembersSnapshot(lobbyMembersSnapshot);
 }