示例#1
0
 protected override void execute(CSteamID executorID, string parameter)
 {
     if (!Dedicator.isDedicated)
     {
         return;
     }
     if (SteamBlacklist.list.Count == 0)
     {
         CommandWindow.LogError(this.localization.format("NoBansErrorText"));
         return;
     }
     CommandWindow.Log(this.localization.format("BansText"));
     for (int i = 0; i < SteamBlacklist.list.Count; i++)
     {
         SteamBlacklistID steamBlacklistID = SteamBlacklist.list[i];
         CommandWindow.Log(this.localization.format("BanNameText", new object[]
         {
             steamBlacklistID.playerID
         }));
         CommandWindow.Log(this.localization.format("BanJudgeText", new object[]
         {
             steamBlacklistID.judgeID
         }));
         CommandWindow.Log(this.localization.format("BanStatusText", new object[]
         {
             steamBlacklistID.reason,
             steamBlacklistID.duration,
             steamBlacklistID.getTime()
         }));
     }
 }
示例#2
0
 // Token: 0x06002FAF RID: 12207 RVA: 0x0013B9AC File Offset: 0x00139DAC
 public static void load()
 {
     SteamBlacklist._list = new List <SteamBlacklistID>();
     if (ServerSavedata.fileExists("/Server/Blacklist.dat"))
     {
         River river = ServerSavedata.openRiver("/Server/Blacklist.dat", true);
         byte  b     = river.readByte();
         if (b > 1)
         {
             ushort num = river.readUInt16();
             for (ushort num2 = 0; num2 < num; num2 += 1)
             {
                 CSteamID newPlayerID = river.readSteamID();
                 uint     newIP;
                 if (b > 2)
                 {
                     newIP = river.readUInt32();
                 }
                 else
                 {
                     newIP = 0u;
                 }
                 CSteamID         newJudgeID       = river.readSteamID();
                 string           newReason        = river.readString();
                 uint             newDuration      = river.readUInt32();
                 uint             newBanned        = river.readUInt32();
                 SteamBlacklistID steamBlacklistID = new SteamBlacklistID(newPlayerID, newIP, newJudgeID, newReason, newDuration, newBanned);
                 if (!steamBlacklistID.isExpired)
                 {
                     SteamBlacklist.list.Add(steamBlacklistID);
                 }
             }
         }
     }
 }
示例#3
0
        // Token: 0x06002FB0 RID: 12208 RVA: 0x0013BA70 File Offset: 0x00139E70
        public static void save()
        {
            River river = ServerSavedata.openRiver("/Server/Blacklist.dat", false);

            river.writeByte(SteamBlacklist.SAVEDATA_VERSION);
            river.writeUInt16((ushort)SteamBlacklist.list.Count);
            ushort num = 0;

            while ((int)num < SteamBlacklist.list.Count)
            {
                SteamBlacklistID steamBlacklistID = SteamBlacklist.list[(int)num];
                river.writeSteamID(steamBlacklistID.playerID);
                river.writeUInt32(steamBlacklistID.ip);
                river.writeSteamID(steamBlacklistID.judgeID);
                river.writeString(steamBlacklistID.reason);
                river.writeUInt32(steamBlacklistID.duration);
                river.writeUInt32(steamBlacklistID.banned);
                num += 1;
            }
            river.closeRiver();
        }
示例#4
0
        // Token: 0x06002FAE RID: 12206 RVA: 0x0013B918 File Offset: 0x00139D18
        public static bool checkBanned(CSteamID playerID, uint ip, out SteamBlacklistID blacklistID)
        {
            blacklistID = null;
            int i = 0;

            while (i < SteamBlacklist.list.Count)
            {
                if (SteamBlacklist.list[i].playerID == playerID || (SteamBlacklist.list[i].ip == ip && ip != 0u))
                {
                    if (SteamBlacklist.list[i].isExpired)
                    {
                        SteamBlacklist.list.RemoveAt(i);
                        return(false);
                    }
                    blacklistID = SteamBlacklist.list[i];
                    return(true);
                }
                else
                {
                    i++;
                }
            }
            return(false);
        }
示例#5
0
 public static bool checkBanned(CSteamID playerID, out SteamBlacklistID blacklistID)
 {
     return(SteamBlacklist.checkBanned(playerID, 0u, out blacklistID));
 }