Example #1
0
    // Token: 0x06001A44 RID: 6724 RVA: 0x0008A2FC File Offset: 0x000884FC
    public static void KickPlayer(string connection, int cmid)
    {
        GamePeerAction peer = new GamePeerAction();

        peer.Connect(connection);
        peer._onConnect = delegate()
        {
            peer.Operations.SendKickPlayer(cmid, PlayerDataManager.AuthToken, PlayerDataManager.MagicHash);
        };
    }
Example #2
0
    // Token: 0x06000D16 RID: 3350 RVA: 0x0005A89C File Offset: 0x00058A9C
    private void ApplyModeration()
    {
        if (PlayerDataManager.AccessLevel >= MemberAccessLevel.Moderator && this._moderations.Exists((ModerationPanelGUI.Moderation m) => m.ID == this._moderationSelection))
        {
            switch (this._moderationSelection)
            {
            case ModerationPanelGUI.Actions.UNMUTE_PLAYER:
                AutoMonoBehaviour <CommConnectionManager> .Instance.Client.Lobby.Operations.SendModerationMutePlayer(0, this._selectedCommUser.Cmid, false);

                PopupSystem.ShowMessage("Action Executed", string.Format("The Player '{0}' was unmuted.", this._selectedCommUser.Name));
                break;

            case ModerationPanelGUI.Actions.GHOST_PLAYER:
                AutoMonoBehaviour <CommConnectionManager> .Instance.Client.Lobby.Operations.SendModerationMutePlayer(this._banDurationIndex, this._selectedCommUser.Cmid, false);

                PopupSystem.ShowMessage("Action Executed", string.Format("The Player '{0}' was ghosted for {1} minutes.", this._selectedCommUser.Name, this._banDurationIndex));
                break;

            case ModerationPanelGUI.Actions.MUTE_PLAYER:
                AutoMonoBehaviour <CommConnectionManager> .Instance.Client.Lobby.Operations.SendModerationMutePlayer(this._banDurationIndex, this._selectedCommUser.Cmid, true);

                AutoMonoBehaviour <CommConnectionManager> .Instance.Client.Lobby.Operations.SendModerationMutePlayer(this._banDurationIndex, this._selectedCommUser.Cmid, false);

                PopupSystem.ShowMessage("Action Executed", string.Format("The Player '{0}' was muted for {1} minutes.", this._selectedCommUser.Name, this._banDurationIndex));
                break;

            case ModerationPanelGUI.Actions.KICK_FROM_GAME:
                if (this._selectedCommUser.CurrentGame != null && this._selectedCommUser.CurrentGame.Server != null)
                {
                    GamePeerAction.KickPlayer(this._selectedCommUser.CurrentGame.Server.ConnectionString, this._selectedCommUser.Cmid);
                    PopupSystem.ShowMessage("Action Executed", string.Format("The Player '{0}' was kicked out of his current game!", this._selectedCommUser.Name));
                }
                else
                {
                    PopupSystem.ShowMessage("Warning", string.Format("The Player '{0}' is currently not in a game!", this._selectedCommUser.Name));
                }
                break;

            case ModerationPanelGUI.Actions.KICK_FROM_APP:
                AutoMonoBehaviour <CommConnectionManager> .Instance.Client.Lobby.Operations.SendModerationBanPlayer(this._selectedCommUser.Cmid);

                PopupSystem.ShowMessage("Action Executed", string.Format("The Player '{0}' was disconnected from all servers!", this._selectedCommUser.Name));
                break;
            }
            this._moderationSelection = ModerationPanelGUI.Actions.NONE;
            foreach (ModerationPanelGUI.Moderation moderation in this._moderations)
            {
                moderation.Selected = false;
            }
        }
    }