Ejemplo n.º 1
0
        private static async void Login()
        {
            while (true)
            {
                Console.WriteLine($"Enter Username");
                _username = Console.ReadLine();
                var loginRes = await _clientConnector.SendRequestAsync(LoginRequestPacket.MODULE, LoginRequestPacket.MODULE, new LoginRequestPacket()
                {
                    Username = _username
                }) as LoginResponsePacket;

                Console.WriteLine($"loginRes: {JsonConvert.SerializeObject(loginRes)}");

                if (loginRes.RetCode == true)
                {
                    if (_menusHandler._isStarted == false)
                    {
                        new Task(() => _menusHandler.TopLevelMenu()).Start();
                    }
                    return;
                }
            }
        }