Exemple #1
0
        async Task IMultiplayerClient.UserJoined(MultiplayerRoomUser user)
        {
            if (Room == null)
            {
                return;
            }

            await PopulateUser(user);

            Schedule(() =>
            {
                if (Room == null)
                {
                    return;
                }

                Room.Users.Add(user);

                RoomChanged?.Invoke();
            });
        }
Exemple #2
0
        Task IMultiplayerClient.UserLeft(MultiplayerRoomUser user)
        {
            if (Room == null)
            {
                return(Task.CompletedTask);
            }

            Schedule(() =>
            {
                if (Room == null)
                {
                    return;
                }

                Room.Users.Remove(user);
                PlayingUsers.Remove(user.UserID);

                RoomChanged?.Invoke();
            });

            return(Task.CompletedTask);
        }
Exemple #3
0
 protected async Task PopulateUser(MultiplayerRoomUser multiplayerUser) => multiplayerUser.User ??= await userLookupCache.GetUserAsync(multiplayerUser.UserID);