コード例 #1
0
 private void ProcessJoinResult(SessionJoinResultPacket obj)
 {
     if (obj.Result == SessionJoinResultPacket.SessionJoinResult.Succesful)
     {
         // Change the view
         FlowController.WebControl.DocumentReady -= WebControlOnDocumentReady;
         FlowController.ChangeView(new InRoomView());
     }
 }
コード例 #2
0
ファイル: LoginView.cs プロジェクト: Damian666/blasters
        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;
            }
        }
コード例 #3
0
 private void WebControlOnDocumentReady(object sender, UrlEventArgs urlEventArgs)
 {
     FlowController.ChangeView(new LoginView());
 }