Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.Title = "WCF_GameClient";
            ILogonService proxy = ChannelFactory <ILogonService> .CreateChannel(
                new NetTcpBinding(),
                new EndpointAddress("net.tcp://localhost:9000/GameHostEndPoint"));

            for (int logonAttemptCount = 0; logonAttemptCount < 3; logonAttemptCount++)
            {
                Console.WriteLine("Enter text and hit return: ");
                string UserName = Console.ReadLine();
                string Password = Console.ReadLine();
                Guid?  result   = proxy.Logon(UserName, Password);
                Console.WriteLine("Server returned: " + result);
                if (result != null)
                {
                    SessionToken = result;
                    break;
                }
            }
            if (SessionToken != null)
            {
                GoGame();
            }
            else
            {
                Console.WriteLine("Logon Failed");
            }
        }
        public LogonViewModel()
        {
            _dialogs = new DialogObjects();
            _dialogs.SetViewModel(this);

            _service = new LogonService();

            IsLoading(false);

            LogonCmd = new DelegateCommand(OnLogon);

            LogonReq = new AuthLogin();

            UserName = string.Empty;
            Password = string.Empty;

            var b = App.Current.Properties["LoginUser"];
        }
Ejemplo n.º 3
0
 public void Setup()
 {
     _logonService = new LogonService("your-256-bit-secret", TimeSpan.FromMinutes(1));
 }
Ejemplo n.º 4
0
 public LogonController(ILogonService logonService)
 {
     _logonService = logonService;
 }
Ejemplo n.º 5
0
 public Post()
 {
     _logonService = new FakeLogonService();
 }
Ejemplo n.º 6
0
 public LogonController(ILogonService service)
 {
     _service = service;
 }