Ejemplo n.º 1
0
    private void handleAvatarRemoval(TcpClient pTcpClient)
    {
        AvatarObject clientAvatar;

        clientDict.TryGetValue(pTcpClient, out clientAvatar);

        RemoveAvatar removeAvatar = new RemoveAvatar(clientAvatar.id);

        foreach (KeyValuePair <TcpClient, AvatarObject> client in clientDict)
        {
            sendObject(client.Key, removeAvatar, client.Value.id);
        }

        allAvatars.Remove(clientAvatar);
        clientDict.Remove(pTcpClient);
        //avatarDict.Remove(clientAvatar.id);

        pTcpClient.Close();
        Console.WriteLine($"{DateTime.Now.ToString("hh:mm:ss")} Removed {pTcpClient} with ID: {clientAvatar.id} from server");
        clientDict.Remove(pTcpClient);
    }
Ejemplo n.º 2
0
 public async Task HandleAsync(RemoveAvatar command)
 => await CreateForAuthenticatedUserAsync(command);
Ejemplo n.º 3
0
 private void removeAvatar(RemoveAvatar pRemoveAvatar)
 {
     _avatarAreaManager.RemoveAvatarView(pRemoveAvatar.id);
 }