Universe.Modules.Ban.BanCheck.UnBlockUser C# (CSharp) Method

UnBlockUser() protected method

protected UnBlockUser ( IScene scene, string cmdparams ) : void
scene IScene
cmdparams string
return void
        protected void UnBlockUser (IScene scene, string [] cmdparams)
        {
            string name = MainConsole.Instance.Prompt ("Name: ");
            UserAccount account = m_accountService.GetUserAccount (null, name);
            if (account == null) {
                MainConsole.Instance.Warn ("Cannot find user.");
                return;
            }

            UUID agentID = account.PrincipalID;
            PresenceInfo info = GetInformation (agentID);
            if (info == null) {
                MainConsole.Instance.Warn ("Cannot find user.");
                return;
            }
            info.Flags = PresenceInfo.PresenceInfoFlags.Clean;
            presenceInfo.UpdatePresenceInfo (info);

            var conn = Framework.Utilities.DataManager.RequestPlugin<IAgentConnector> ();
            IAgentInfo agentInfo = conn.GetAgent (agentID);

            agentInfo.Flags &= IAgentFlags.TempBan;
            agentInfo.Flags &= IAgentFlags.PermBan;
            if (agentInfo.OtherAgentInformation.ContainsKey ("TemperaryBanInfo"))
                agentInfo.OtherAgentInformation.Remove ("TemperaryBanInfo");
            conn.UpdateAgent (agentInfo);

            MainConsole.Instance.Fatal ("User block removed");
        }