コード例 #1
0
        public LoginReply Logi(LoginRequest request)
        {
            bool loggedIn = false;

            lock (this)
            {
                loggedIn = serverManagement.Login(request.User, request.Password, request.Url);
            }
            if (loggedIn)
            {
                Console.WriteLine($"Client {request.User.Name} with Id {request.User.Id} logged in at {request.Url}");
                return(new LoginReply
                {
                    Ok = true
                });
            }
            else
            {
                Console.WriteLine($"Client {request.User.Name} with Id {request.User.Id} FAILED to log in at {request.Url}");
                return(new LoginReply
                {
                    Ok = false
                });
            }
        }