Exemplo n.º 1
0
        // Token: 0x06001E38 RID: 7736 RVA: 0x000A5374 File Offset: 0x000A3774
        protected override void execute(CSteamID executorID, string parameter)
        {
            if (!Dedicator.isDedicated)
            {
                return;
            }
            if (!Provider.isServer)
            {
                CommandWindow.LogError(this.localization.format("NotRunningErrorText"));
                return;
            }
            CSteamID csteamID;

            if (!PlayerTool.tryGetSteamID(parameter, out csteamID))
            {
                CommandWindow.LogError(this.localization.format("InvalidSteamIDErrorText", new object[]
                {
                    parameter
                }));
                return;
            }
            if (!SteamBlacklist.unban(csteamID))
            {
                CommandWindow.LogError(this.localization.format("NoPlayerErrorText", new object[]
                {
                    csteamID
                }));
                return;
            }
            CommandWindow.Log(this.localization.format("UnbanText", new object[]
            {
                csteamID
            }));
        }
Exemplo n.º 2
0
 public static void save()
 {
     if (Level.info.type == ELevelType.SURVIVAL)
     {
         for (int i = 0; i < Provider.clients.Count; i++)
         {
             if (Provider.clients[i].model != null)
             {
                 Player component = Provider.clients[i].model.GetComponent <Player>();
                 component.save();
             }
         }
         VehicleManager.save();
         BarricadeManager.save();
         StructureManager.save();
         ObjectManager.save();
         LightingManager.save();
         GroupManager.save();
     }
     if (Dedicator.isDedicated)
     {
         SteamWhitelist.save();
         SteamBlacklist.save();
         SteamAdminlist.save();
     }
 }
Exemplo n.º 3
0
        protected override void execute(CSteamID executorID, string parameter)
        {
            if (!Dedicator.isDedicated)
            {
                return;
            }
            if (!Provider.isServer)
            {
                CommandWindow.LogError(this.localization.format("NotRunningErrorText"));
                return;
            }
            string[] componentsFromSerial = Parser.getComponentsFromSerial(parameter, '/');
            if (componentsFromSerial.Length != 1 && componentsFromSerial.Length != 2)
            {
                CommandWindow.LogError(this.localization.format("InvalidParameterErrorText"));
                return;
            }
            SteamPlayer steamPlayer;

            if (!PlayerTool.tryGetSteamPlayer(componentsFromSerial[0], out steamPlayer))
            {
                CommandWindow.LogError(this.localization.format("NoPlayerErrorText", new object[]
                {
                    componentsFromSerial[0]
                }));
                return;
            }
            P2PSessionState_t p2PSessionState_t;
            uint ip;

            if (SteamGameServerNetworking.GetP2PSessionState(steamPlayer.playerID.steamID, ref p2PSessionState_t))
            {
                ip = p2PSessionState_t.m_nRemoteIP;
            }
            else
            {
                ip = 0u;
            }
            if (componentsFromSerial.Length == 1)
            {
                SteamBlacklist.ban(steamPlayer.playerID.steamID, ip, executorID, this.localization.format("SlayTextReason"), SteamBlacklist.PERMANENT);
            }
            else if (componentsFromSerial.Length == 2)
            {
                SteamBlacklist.ban(steamPlayer.playerID.steamID, ip, executorID, componentsFromSerial[1], SteamBlacklist.PERMANENT);
            }
            if (steamPlayer.player != null)
            {
                EPlayerKill eplayerKill;
                steamPlayer.player.life.askDamage(101, Vector3.up * 101f, EDeathCause.KILL, ELimb.SKULL, executorID, out eplayerKill);
            }
            CommandWindow.Log(this.localization.format("SlayText", new object[]
            {
                steamPlayer.playerID.playerName
            }));
        }
Exemplo n.º 4
0
 // Token: 0x060027DA RID: 10202 RVA: 0x000F19BC File Offset: 0x000EFDBC
 private void Update()
 {
     if (ChatManager.isVoting && (Time.realtimeSinceStartup - ChatManager.lastVote > ChatManager.voteDuration || ChatManager.voteYes >= ChatManager.votesNeeded || ChatManager.voteNo > ChatManager.votesPossible - ChatManager.votesNeeded))
     {
         ChatManager.isVoting = false;
         if (ChatManager.voteYes >= ChatManager.votesNeeded)
         {
             if (ChatManager.voteOrigin != null)
             {
                 ChatManager.voteOrigin.nextVote = Time.realtimeSinceStartup + ChatManager.votePassCooldown;
             }
             CommandWindow.Log(Provider.localization.format("Vote_Pass"));
             ChatManager.manager.channel.send("tellVoteStop", ESteamCall.CLIENTS, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[]
             {
                 3
             });
             SteamBlacklist.ban(ChatManager.voteTarget, ChatManager.voteIP, CSteamID.Nil, "you were vote kicked", SteamBlacklist.TEMPORARY);
         }
         else
         {
             if (ChatManager.voteOrigin != null)
             {
                 ChatManager.voteOrigin.nextVote = Time.realtimeSinceStartup + ChatManager.voteFailCooldown;
             }
             CommandWindow.Log(Provider.localization.format("Vote_Fail"));
             ChatManager.manager.channel.send("tellVoteStop", ESteamCall.CLIENTS, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[]
             {
                 4
             });
         }
     }
     if (ChatManager.needsVote && !ChatManager.hasVote)
     {
         if (Input.GetKeyDown(KeyCode.F1))
         {
             ChatManager.needsVote = false;
             ChatManager.hasVote   = true;
             ChatManager.sendVote(true);
         }
         else if (Input.GetKeyDown(KeyCode.F2))
         {
             ChatManager.needsVote = false;
             ChatManager.hasVote   = true;
             ChatManager.sendVote(false);
         }
     }
 }
Exemplo n.º 5
0
 public static bool checkBanned(CSteamID playerID, out SteamBlacklistID blacklistID)
 {
     return(SteamBlacklist.checkBanned(playerID, 0u, out blacklistID));
 }
Exemplo n.º 6
0
 public static void ban(CSteamID playerID, CSteamID judgeID, string reason, uint duration)
 {
     SteamBlacklist.ban(playerID, 0u, judgeID, reason, duration);
 }
Exemplo n.º 7
0
        protected override void execute(CSteamID executorID, string parameter)
        {
            if (!Dedicator.isDedicated)
            {
                return;
            }
            if (!Provider.isServer)
            {
                CommandWindow.LogError(this.localization.format("NotRunningErrorText"));
                return;
            }
            string[] componentsFromSerial = Parser.getComponentsFromSerial(parameter, '/');
            if (componentsFromSerial.Length != 1 && componentsFromSerial.Length != 2 && componentsFromSerial.Length != 3)
            {
                CommandWindow.LogError(this.localization.format("InvalidParameterErrorText"));
                return;
            }
            CSteamID csteamID;

            if (!PlayerTool.tryGetSteamID(componentsFromSerial[0], out csteamID))
            {
                CommandWindow.LogError(this.localization.format("NoPlayerErrorText", new object[]
                {
                    componentsFromSerial[0]
                }));
                return;
            }
            P2PSessionState_t p2PSessionState_t;
            uint ip;

            if (SteamGameServerNetworking.GetP2PSessionState(csteamID, ref p2PSessionState_t))
            {
                ip = p2PSessionState_t.m_nRemoteIP;
            }
            else
            {
                ip = 0u;
            }
            if (componentsFromSerial.Length == 1)
            {
                SteamBlacklist.ban(csteamID, ip, executorID, this.localization.format("BanTextReason"), SteamBlacklist.PERMANENT);
                CommandWindow.Log(this.localization.format("BanTextPermanent", new object[]
                {
                    csteamID
                }));
            }
            else if (componentsFromSerial.Length == 2)
            {
                SteamBlacklist.ban(csteamID, ip, executorID, componentsFromSerial[1], SteamBlacklist.PERMANENT);
                CommandWindow.Log(this.localization.format("BanTextPermanent", new object[]
                {
                    csteamID
                }));
            }
            else
            {
                uint num;
                if (!uint.TryParse(componentsFromSerial[2], out num))
                {
                    CommandWindow.LogError(this.localization.format("InvalidNumberErrorText", new object[]
                    {
                        componentsFromSerial[2]
                    }));
                    return;
                }
                SteamBlacklist.ban(csteamID, ip, executorID, componentsFromSerial[1], num);
                CommandWindow.Log(this.localization.format("BanText", new object[]
                {
                    csteamID,
                    num
                }));
            }
        }