public ChatClientRegisterReply Reg(ChatClientRegisterRequest request) { User newUser; lock (this) { newUser = serverManagement.CreateUser(request.User, request.Password); } Console.WriteLine($"Registered client {newUser.Name} with Id {newUser.Id}"); return(new ChatClientRegisterReply { Ok = true, User = newUser }); }