Beispiel #1
0
        private void SendLoginRequest()
        {
            LoginResponse response = UserServiceProxy.Login(new LoginRequest {
                UserName = this.UserName, Password = this.Password
            });

            ConsoleLog.Document += $" { response.IsSuccess } {response.Message} \n ";
            if (response.IsSuccess == true)
            {
                //save loged user authentication
                AuthenticatedUser.Authentication = response.Authentication;
                AuthenticatedUser.UserName       = this.UserName;
                //update contactList
                ContactStateManager.AssignAllCurrentOnlineContacts(response.AllOtherUsers);
                //joining the chat service:
                JoinChatServiceResponse responseFromChatService = ChatServiceProxy.JoinService(new JoinChatServiceRequest());
                ConsoleLog.Document += responseFromChatService.Message;
                //joining the Game Service:
                JoinGameServiceResponse responseFromGameService = GameServiceProxy.JoinService(new JoinGameServiceRequest());
                ConsoleLog.Document           += responseFromGameService.Message;
                UserServiceProxy.OnLoginEvent += UserServiceProxy_OnLoginEvent;
                ViewChanging("ContactListView");
                //set online users to something : new class that will save online users
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            var userServiceProxy = new UserServiceProxy();

            var response = userServiceProxy.Login(new LoginRequest {
                UserName = "******", Password = "******"
            });

            Console.WriteLine(response.IsSuccess + response.Message);
            foreach (var user in response.AllOtherUsers)
            {
                Console.WriteLine(user.UserName);
            }
            Console.ReadLine();
        }