private void ProcessJoinResult(SessionJoinResultPacket obj) { if (obj.Result == SessionJoinResultPacket.SessionJoinResult.Succesful) { // Change the view FlowController.WebControl.DocumentReady -= WebControlOnDocumentReady; FlowController.ChangeView(new InRoomView()); } }
private void Handler(object sender, JavascriptMethodEventArgs args) { switch (args.MethodName.ToLower()) { case "close": { Application.Exit(); } break; case "openhomepage": { Process.Start("http://blastersonline.com"); } break; case "openforums": { Process.Start("http://blasters.skideria.com"); } break; default: { var username = FlowController.WebControl.ExecuteJavascriptWithResult("document.getElementById('txt-username').value"); var password = FlowController.WebControl.ExecuteJavascriptWithResult("document.getElementById('txt-password').value"); if (username.ToString() == string.Empty || password.ToString() == string.Empty) { var code = "bootbox.alert('You must specify a valid username and password. The given credentials are incorrect.');"; FlowController.WebControl.ExecuteJavascript(code); return; } var packet = new LoginRequestPacket(username, password); NetworkManager.Instance.SendPacket(packet); // Wait a moment //Thread.Sleep(500); // Change the view FlowController.ChangeView(new RoomSelectView()); } break; } }
private void WebControlOnDocumentReady(object sender, UrlEventArgs urlEventArgs) { FlowController.ChangeView(new LoginView()); }