public void Logout()
 {
     _store.SetSession(null);
     currentSession = null;
     OnLogout?.Invoke(this, EventArgs.Empty);
     SessionChanged?.Invoke(this, EventArgs.Empty);
 }
Ejemplo n.º 2
0
        public void Logout()
        {
            Token      = "";
            IsLoggedIn = false;

            OnLogout?.Invoke(this, EventArgs.Empty);
        }
            public override WebResourceResponse ShouldInterceptRequest(WebView view, IWebResourceRequest request)
            {
                if (request.Url.LastPathSegment != null)
                {
                    if (request.Url.LastPathSegment.EndsWith("s"))
                    {
                        if (request.Url.LastPathSegment.EndsWith("common.css"))
                        {
                            return(CssHelper.GetCssResponse(CssHelper.CommonCssSettings));
                        }
                    }
                    if (request.Url.LastPathSegment.EndsWith(@"t/"))
                    {
                        if (request.Url.ToString() == @"https://www.bitchute.com/accounts/logout/")
                        {
                            if (request.Method == "GET")
                            {
                                if (OnLogout == null)
                                {
                                    OnLogout += RunOnLogout;
                                    OnLogout += RunPostAuthEvent.OnPostLogout;
                                }
                                OnLogout.Invoke(new LogoutEventArgs());
                                AppState.UserIsLoggedIn = false;
                            }
                        }
                    }
                }

                return(base.ShouldInterceptRequest(view, request));
            }
Ejemplo n.º 4
0
    private void TryLogout()
    {
        UnityWebRequest httpClient = new UnityWebRequest(player.HttpServerAddress + "api/Account/Logout", "POST");

        httpClient.SetRequestHeader("Authorization", "bearer " + player.Token);
        httpClient.SendWebRequest();
        while (!httpClient.isDone)
        {
            Task.Delay(1);
        }

        if (httpClient.isNetworkError || httpClient.isHttpError)
        {
            throw new Exception("Login > TryLogout: " + httpClient.error);
        }
        else
        {
            OnLogout?.Invoke("" + httpClient.responseCode);
            player.Token    = string.Empty;
            player.Id       = string.Empty;
            player.Email    = string.Empty;
            player.Name     = string.Empty;
            player.BirthDay = DateTime.MinValue;
        }
    }
Ejemplo n.º 5
0
 public void Logout(object caller)
 {
     LoggedIn = false;
     ApiClient.ClearAuth();
     ChangeView(EvotoView.Login);
     OnLogout?.Invoke(caller, EventArgs.Empty);
 }
        public void Logout()
        {
            m_CanvasGroup.alpha = 1;
            loginPanel.SetActive(true);

            OnLogout?.Invoke();
        }
Ejemplo n.º 7
0
 void LogoutInvoke()
 {
     _timer.Change((long)Timeouts.Logout, (long)Timeouts.Logout);
     OnLogout?.Invoke(this, new AgentStateEventArgs {
         Mode = _mode
     }, _monitorId);
 }
Ejemplo n.º 8
0
        private void LogOutButton_Click(object sender, EventArgs e)
        {
            controller.LogOut();

            OnLogout?.Invoke(this, EventArgs.Empty);

            // No need to reset the view as we are expecting the parent to dispose it.
        }
Ejemplo n.º 9
0
        public async void Logout()
        {
            await authenticationManager.Logout();

            await Shell.Current.GoToAsync("//login");

            OnLogout?.Invoke(this, EventArgs.Empty);
        }
Ejemplo n.º 10
0
 private void LoginWithConnectCode(string connectCode)
 {
     socket.EmitAsync("connectCode", connectCode).ContinueWith(task =>
     {
         if (!task.IsCompleted)
         {
             OnLogout?.Invoke(this, "LoginFail");
         }
         else
         {
             "OK".Log();
         }
     });
 }
Ejemplo n.º 11
0
 private void LoginWithDiscord(string discordID)
 {
     socket.EmitAsync("discordID", discordID).ContinueWith(task =>
     {
         if (!task.IsCompleted)
         {
             OnLogout?.Invoke(this, "LoginFail");
         }
         else
         {
             "OK".Log();
         }
     });
 }
Ejemplo n.º 12
0
        private void FrameworkOnOnUpdateEvent(Framework framework)
        {
            if (this.Condition.Any() && this.lastConditionNone == true)
            {
                Log.Debug("Is login");
                this.lastConditionNone = false;
                OnLogin?.Invoke(this, null);
            }

            if (!this.Condition.Any() && this.lastConditionNone == false)
            {
                Log.Debug("Is logout");
                this.lastConditionNone = true;
                OnLogout?.Invoke(this, null);
            }
        }
Ejemplo n.º 13
0
 public void Logout()
 {
     if (UserCredential?.Token?.RefreshToken != null)
     {
         // Not sure if it's possible for m_User to be null here.
         if (Profile != null)
         {
             ControllerConsoleScript.m_Instance.AddNewLine(Profile.name + " logged out.");
         }
         else
         {
             ControllerConsoleScript.m_Instance.AddNewLine("Logged out.");
         }
         m_CredentialRequest.RevokeCredential();
         m_TokenDataStore.ClearAsync();
         Profile = null;
     }
     OnLogout?.Invoke();
 }
Ejemplo n.º 14
0
 public void Logout()
 {
     if (!isLogin)
     {
         OnError?.Invoke("Вы еще не авторизировались.");
     }
     else
     {
         string path = "token.json";
         if (Directory.Exists(path))
         {
             Directory.Delete(path, true);
         }
         isLogin    = false;
         credential = null;
         isAlreadyInLoginProcess = false;
         OnLogout?.Invoke();
     }
 }
Ejemplo n.º 15
0
        private void RaiseOnResponse(string message)
        {
            var rawMessage = message.Split(':');
            var type       = rawMessage[0];

            if (type.Contains("error"))
            {
                OnLoginError?.Invoke(rawMessage[2]);
                return;
            }

            if (type.Contains("shutdown"))
            {
                OnLoginError?.Invoke(rawMessage[2]);
                return;
            }

            if (type.Contains("login"))
            {
                OnLogin?.Invoke();
                return;
            }

            if (type.Contains("logout"))
            {
                DestroyRunTask();
                OnLogout?.Invoke();
                return;
            }

            if (type.Contains("message"))
            {
                OnMessage?.Invoke(rawMessage[2]);
                return;
            }

            if (type.Contains("members"))
            {
                OnMembers?.Invoke(rawMessage[2]);
                return;
            }
        }
Ejemplo n.º 16
0
 public void RaiseOnLogout()
 {
     OnLogout?.Invoke();
 }
Ejemplo n.º 17
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="action"></param>
 public void Logout(OnLogout onLogout)
 {
     player = new PlayerInfo();
     onLogout.Invoke();
 }
Ejemplo n.º 18
0
 internal void OnLogoutCall(HeaderMessage header)
 {
     OnLogout?.Invoke((header));
 }
Ejemplo n.º 19
0
        private void Init()
        {
            socket                    = new SocketIO();
            socket.OnError           += (sender, s) => { MOD.log.LogMessage($"Error {s}"); };
            socket.OnReconnecting    += (sender, i) => { MOD.log.LogMessage($"Reconnecting {i}"); };
            socket.OnReconnectFailed += (sender, exception) => exception.Log();
            socket.OnConnected       += (sender, e) =>
            {
                if (!string.IsNullOrEmpty(ConnectCode))
                {
                    Login(ConnectCode);
                }
                OnConnected?.Invoke(this, socket.ServerUri.ToString());
            };

            // Handle socket disconnection events.
            socket.OnDisconnected += (sender, e) =>
            {
                MOD.log.LogMessage("Disconnected" + e);
                OnDisconnected?.Invoke(this, EventArgs.Empty);
            };

            socket.OnReceivedEvent += (sender, args) =>
            {
                $"Event {args.Event} received".Log();
            };

            socket.On("refresh", response => OnRefresh?.Invoke(null, null));

            socket.On("error", response =>
            {
                if (response.Count == 0)
                {
                    return;
                }
                MOD.log.LogMessage($@"Error Received: {response}");
            });

            socket.On("register", response =>
            {
                MOD.log.LogMessage($@"Register Received: {response}");
                if (response.Count != 1)
                {
                    return;
                }
                var id = response.GetValue().ToString();
                if (id.Length != 18)
                {
                    return;
                }
                OnLogin?.Invoke(this, id);
            });

            socket.On("matchID", response =>
            {
                MOD.log.LogMessage("MatchID Received: " + response);
                var matchID = response.GetValue().ToString();
                int.TryParse(matchID, out var id);
                OnMatchID?.Invoke(null, id);
            });

            socket.On("unregister", response =>
            {
                MOD.log.LogMessage("Unregister Received: " + response);
                var motive = "";
                if (response.Count == 1)
                {
                    motive = "Motive: " + response.GetValue();
                }

                OnLogout?.Invoke(this, motive);
            });
        }
Ejemplo n.º 20
0
        private void InitControls()
        {
            #region Staff Panel
            var staffTitle = new Label("___Panel Pracownika___")
            {
                X = Pos.Center() - 11,
                Y = Pos.Percent(10),
            };


            var reservationManageButton = new Button("Zarządzaj rezerwacjami [F1]")
            {
                X = Pos.Percent(33) - 11,
                Y = Pos.Percent(20),
            };


            var carManageButton = new Button("Zarządzaj samochodami [F2]")
            {
                X = Pos.Percent(66) - 11,
                Y = Pos.Percent(20),
            };


            var modelManageButton = new Button("Zarządzaj modelami [F3]")
            {
                X = Pos.Percent(33) - 9,
                Y = Pos.Percent(30),
            };


            var markManageButton = new Button("Zarządzaj markami [F4]")
            {
                X = Pos.Percent(66) - 9,
                Y = Pos.Percent(30),
            };

            var settingsButton = new Button("Ustawienia Aplikacji [F5]")
            {
                X = Pos.Center() - 10,
                Y = Pos.Percent(40),
            };

            Add(staffTitle);
            Add(reservationManageButton);
            Add(carManageButton);
            Add(modelManageButton);
            Add(markManageButton);
            Add(settingsButton);
            #endregion

            #region Admin Panel
            var adminTitle = new Label("___Panel Administratora___")
            {
                X = Pos.Center() - 13,
                Y = Pos.Percent(50),
            };


            var userManageButton = new Button("Zarządzaj użytkownikami")
            {
                X = Pos.Center() - 12,
                Y = Pos.Percent(60),
            };

            if (user.Rola == Model.UserRole.Admin)
            {
                Add(adminTitle);
                Add(userManageButton);
            }
            #endregion

            #region Logout and Exit Button
            var exitButton = new Button("Wyjdź [F6]")
            {
                X = Pos.Percent(50) - 15,
                Y = Pos.Percent(100) - 2,
            };
            Add(exitButton);
            var logoutButton = new Button("Wyloguj [F7]")
            {
                X = Pos.Percent(50) + 5,
                Y = Pos.Percent(100) - 2,
            };
            Add(logoutButton);
            #endregion

            #region bind-button-events


            exitButton.Clicked += () =>
            {
                //Close();
                OnExit?.Invoke();
            };

            logoutButton.Clicked += () =>
            {
                //Close();
                OnLogout?.Invoke();
            };

            reservationManageButton.Clicked += () =>
            {
                //Close();
                OnSelect?.Invoke(1);
            };

            carManageButton.Clicked += () =>
            {
                //Close();
                OnSelect?.Invoke(2);
            };

            modelManageButton.Clicked += () =>
            {
                //Close();
                OnSelect?.Invoke(3);
            };

            markManageButton.Clicked += () =>
            {
                //Close();
                OnSelect?.Invoke(4);
            };

            userManageButton.Clicked += () =>
            {
                //Close();
                OnSelect?.Invoke(5);
            };

            settingsButton.Clicked += () =>
            {
                OnSelect?.Invoke(6);
            };

            KeyDown += (a) =>
            {
                switch (a.KeyEvent.Key)
                {
                case Key.F1:
                    OnSelect?.Invoke(1);
                    break;

                case Key.F2:
                    OnSelect?.Invoke(2);
                    break;

                case Key.F3:
                    OnSelect?.Invoke(3);
                    break;

                case Key.F4:
                    OnSelect?.Invoke(4);
                    break;

                case Key.F5:
                    OnSelect?.Invoke(6);
                    break;

                case Key.F6:
                    OnExit?.Invoke();
                    break;

                case Key.F7:
                    OnLogout?.Invoke();
                    break;

                default:
                    break;
                }
            };

            #endregion
        }
Ejemplo n.º 21
0
 private void Opt_Logout_Click(object sender, RoutedEventArgs e)
 {
     OnLogout?.Invoke(this, e);
 }
Ejemplo n.º 22
0
 public static void HandleLogout(object sender, EventArgs e)
 {
     OnLogout.Invoke(sender, e);
 }
Ejemplo n.º 23
0
 private void BtnLogout_OnClick()
 {
     OnLogout?.Invoke();
 }
Ejemplo n.º 24
0
        private void InitControls()
        {
            #region User Panel
            var showCarsButton = new Button("Przeglądaj samochody [F1] ")
            {
                X = Pos.Percent(33) - 12,
                Y = Pos.Percent(10),
            };

            var rentCarButton = new Button("Wypożycz samochód [F2] ")
            {
                X = Pos.Percent(66) - 11,
                Y = Pos.Percent(10),
            };

            var historyButton = new Button("Historia wypożyczeń [F3] ")
            {
                X = Pos.Percent(33) - 12,
                Y = Pos.Percent(20),
            };

            var accountButton = new Button("Moje Konto [F4] ")
            {
                X = Pos.Percent(66) - 7,
                Y = Pos.Percent(20),
            };

            var setingsButton = new Button("Ustawienia [F5] ")
            {
                X = Pos.Percent(33) - 7,
                Y = Pos.Percent(30),
            };

            var exitButton = new Button("Wyjdź [F6] ")
            {
                X = Pos.Percent(66) - 5,
                Y = Pos.Percent(30),
            };

            Add(showCarsButton);
            Add(rentCarButton);
            Add(historyButton);
            Add(accountButton);
            Add(setingsButton);
            Add(exitButton);

            StringBuilder carImage = new StringBuilder();
            carImage.AppendLine(@"   yNNNNNNNNNNNNNNNNNNNNNNy   ");
            carImage.AppendLine(@"  .MM                    MM.  ");
            carImage.AppendLine(@"  :Md                    dM:  ");
            carImage.AppendLine(@"  oMy                    yMo  ");
            carImage.AppendLine(@"  yMdssssssssssssssssssssdMy  ");
            carImage.AppendLine(@"omMNdmMMMMMMMMMMMMMMMMMMmdNMmo");
            carImage.AppendLine(@"MMy   /MMMMMMMMMMMMMMMM/   yMM");
            carImage.AppendLine(@"MMh. `sMMMMMMMMMMMMMMMMs` .hMM");
            carImage.AppendLine(@"MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM");
            carImage.AppendLine(@"MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM");
            carImage.AppendLine(@"+mMMMMMMMMMMMMMMMMMMMMMMMMMMm+");
            carImage.AppendLine(@"  sMMMm                mMMMs  ");
            carImage.AppendLine(@"  sMMMm                mMMMs  ");
            carImage.AppendLine(@"  :mMN+                +mNd-  ");
            carImage.AppendLine("");

            var imageLabel = new Label(carImage.ToString())
            {
                X = Pos.Percent(38),
                Y = Pos.Percent(40),
            };

            Add(imageLabel);

            #endregion

            #region Logout Button
            var logoutButton = new Button("Wyloguj [F7] ")
            {
                X = Pos.Center() - 7,
                Y = Pos.Percent(100) - 2,
            };
            Add(logoutButton);
            #endregion

            #region bind-button-events


            exitButton.Clicked += () =>
            {
                //Close();
                OnExit?.Invoke();
            };

            logoutButton.Clicked += () =>
            {
                //Close();
                OnLogout?.Invoke();
            };

            showCarsButton.Clicked += () =>
            {
                //Close();
                OnSelect?.Invoke(1);
            };

            rentCarButton.Clicked += () =>
            {
                //Close();
                OnSelect?.Invoke(2);
            };

            historyButton.Clicked += () =>
            {
                //Close();
                OnSelect?.Invoke(3);
            };

            accountButton.Clicked += () =>
            {
                //Close();
                OnSelect?.Invoke(4);
            };

            setingsButton.Clicked += () =>
            {
                //Close();
                OnSelect?.Invoke(5);
            };

            #endregion

            KeyDown += (a) =>
            {
                switch (a.KeyEvent.Key)
                {
                case Key.F1:
                    OnSelect?.Invoke(1);
                    break;

                case Key.F2:
                    OnSelect?.Invoke(2);
                    break;

                case Key.F3:
                    OnSelect?.Invoke(3);
                    break;

                case Key.F4:
                    OnSelect?.Invoke(4);
                    break;

                case Key.F5:
                    OnSelect?.Invoke(5);
                    break;

                case Key.F6:
                    OnExit?.Invoke();
                    break;

                case Key.F7:
                    OnLogout?.Invoke();
                    break;

                default:
                    break;
                }
            };
        }
Ejemplo n.º 25
0
 public void LogoutClick(object sender, RoutedEventArgs e)
 {
     OnLogout?.Invoke(sender, e);
 }
Ejemplo n.º 26
0
 public void RaiseOnLogout()
 {
     ThreadManager.ExecuteOnMainThread(() => OnLogout?.Invoke());
 }
Ejemplo n.º 27
0
 public static void InvokeLogout(Mobile m)
 {
     OnLogout?.Invoke(m);
 }
Ejemplo n.º 28
0
 public void Handle(OnLogout message)
 {
     ActiveItem = _loginWindowViewModel;
 }
Ejemplo n.º 29
0
 public void Logout(OnLogout action)
 {
     action.Invoke();
 }
Ejemplo n.º 30
0
 public void Offline(string user)
 {
     OnLogout?.Invoke(user);
 }