예제 #1
0
        protected override void execute(CSteamID executorID, string parameter)
        {
            if (!Provider.isServer)
            {
                CommandWindow.LogError(this.localization.format("NotRunningErrorText"));
                return;
            }
            if (Provider.isServer && Level.info.type == ELevelType.HORDE)
            {
                CommandWindow.LogError(this.localization.format("HordeErrorText"));
                return;
            }
            if (Provider.isServer && Level.info.type == ELevelType.ARENA)
            {
                CommandWindow.LogError(this.localization.format("ArenaErrorText"));
                return;
            }
            uint num;

            if (!uint.TryParse(parameter, out num))
            {
                CommandWindow.LogError(this.localization.format("InvalidNumberErrorText", new object[]
                {
                    parameter
                }));
                return;
            }
            LightingManager.time = num;
            CommandWindow.Log(this.localization.format("TimeText", new object[]
            {
                num
            }));
        }
예제 #2
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
            }));
        }
예제 #3
0
        protected override void execute(CSteamID executorID, string parameter)
        {
            if (!Provider.isServer)
            {
                CommandWindow.LogError(this.localization.format("NotRunningErrorText"));
                return;
            }
            SteamPlayer steamPlayer;

            if (!PlayerTool.tryGetSteamPlayer(parameter, out steamPlayer))
            {
                CommandWindow.LogError(this.localization.format("NoPlayerErrorText", new object[]
                {
                    parameter
                }));
                return;
            }
            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("KillText", new object[]
            {
                steamPlayer.playerID.playerName
            }));
        }
예제 #4
0
        public void build()
        {
            List <SteamChannelMethod> list = new List <SteamChannelMethod>();

            Component[] components = base.GetComponents(typeof(Component));
            for (int i = 0; i < components.Length; i++)
            {
                MemberInfo[] members = components[i].GetType().GetMembers();
                for (int j = 0; j < members.Length; j++)
                {
                    if (members[j].MemberType == MemberTypes.Method)
                    {
                        MethodInfo methodInfo = (MethodInfo)members[j];
                        if (methodInfo.GetCustomAttributes(typeof(SteamCall), true).Length > 0)
                        {
                            ParameterInfo[] parameters = methodInfo.GetParameters();
                            Type[]          array      = new Type[parameters.Length];
                            for (int k = 0; k < parameters.Length; k++)
                            {
                                array[k] = parameters[k].ParameterType;
                            }
                            list.Add(new SteamChannelMethod(components[i], methodInfo, array));
                        }
                    }
                }
            }
            this._calls = list.ToArray();
            if (this.calls.Length > 235)
            {
                CommandWindow.LogError(base.name + " approaching 255 methods!");
            }
        }
예제 #5
0
        // Token: 0x06001E2B RID: 7723 RVA: 0x000A4A1C File Offset: 0x000A2E1C
        protected override void execute(CSteamID executorID, string parameter)
        {
            if (!Provider.isServer)
            {
                CommandWindow.LogError(this.localization.format("NotRunningErrorText"));
                return;
            }
            string[] componentsFromSerial = Parser.getComponentsFromSerial(parameter, '/');
            if (componentsFromSerial.Length != 1)
            {
                CommandWindow.LogError(this.localization.format("InvalidParameterErrorText"));
                return;
            }
            SteamPlayer steamPlayer;

            if (!PlayerTool.tryGetSteamPlayer(componentsFromSerial[0], out steamPlayer) || steamPlayer.player == null)
            {
                CommandWindow.LogError(this.localization.format("NoPlayerErrorText", new object[]
                {
                    componentsFromSerial[0]
                }));
                return;
            }
            steamPlayer.player.sendScreenshot(executorID, null);
            CommandWindow.Log(this.localization.format("SpyText", new object[]
            {
                steamPlayer.playerID.playerName
            }));
        }
예제 #6
0
 private static void onLogMessageReceived(string text, string stack, LogType type)
 {
     if (type == 4)
     {
         CommandWindow.LogError(text + " - " + stack);
     }
 }
예제 #7
0
        // Token: 0x06001E14 RID: 7700 RVA: 0x000A3BA0 File Offset: 0x000A1FA0
        protected override void execute(CSteamID executorID, string parameter)
        {
            if (!Dedicator.isDedicated)
            {
                return;
            }
            ushort num;

            if (!ushort.TryParse(parameter, out num))
            {
                CommandWindow.LogError(this.localization.format("InvalidNumberErrorText", new object[]
                {
                    parameter
                }));
                return;
            }
            if (Provider.isServer)
            {
                CommandWindow.LogError(this.localization.format("RunningErrorText"));
                return;
            }
            Provider.port = num;
            CommandWindow.Log(this.localization.format("PortText", new object[]
            {
                num
            }));
        }
예제 #8
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()
         }));
     }
 }
예제 #9
0
 protected override void execute(CSteamID executorID, string parameter)
 {
     if (!Dedicator.isDedicated)
     {
         return;
     }
     if (SteamWhitelist.list.Count == 0)
     {
         CommandWindow.LogError(this.localization.format("NoPermitsErrorText"));
         return;
     }
     CommandWindow.Log(this.localization.format("PermitsText"));
     for (int i = 0; i < SteamWhitelist.list.Count; i++)
     {
         SteamWhitelistID steamWhitelistID = SteamWhitelist.list[i];
         CommandWindow.Log(this.localization.format("PermitNameText", new object[]
         {
             steamWhitelistID.steamID,
             steamWhitelistID.tag
         }));
         CommandWindow.Log(this.localization.format("PermitJudgeText", new object[]
         {
             steamWhitelistID.judgeID
         }));
     }
 }
예제 #10
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 != 2)
            {
                CommandWindow.LogError(this.localization.format("InvalidParameterErrorText"));
                return;
            }
            CSteamID csteamID;

            if (!PlayerTool.tryGetSteamID(componentsFromSerial[0], out csteamID))
            {
                CommandWindow.LogError(this.localization.format("InvalidSteamIDErrorText", new object[]
                {
                    componentsFromSerial[0]
                }));
                return;
            }
            SteamWhitelist.whitelist(csteamID, componentsFromSerial[1], executorID);
            CommandWindow.Log(this.localization.format("PermitText", new object[]
            {
                csteamID,
                componentsFromSerial[1]
            }));
        }
예제 #11
0
 protected override void execute(CSteamID executorID, string parameter)
 {
     if (!Dedicator.isDedicated)
     {
         return;
     }
     if (!Level.exists(parameter))
     {
         CommandWindow.LogError(this.localization.format("NoMapErrorText", new object[]
         {
             parameter
         }));
         return;
     }
     if (Provider.isServer)
     {
         CommandWindow.LogError(this.localization.format("RunningErrorText"));
         return;
     }
     Provider.map = parameter;
     CommandWindow.Log(this.localization.format("MapText", new object[]
     {
         parameter
     }));
 }
예제 #12
0
 // Token: 0x06001DD3 RID: 7635 RVA: 0x000A12FC File Offset: 0x0009F6FC
 protected override void execute(CSteamID executorID, string parameter)
 {
     if (!Dedicator.isDedicated)
     {
         return;
     }
     if (!Parser.checkIP(parameter))
     {
         CommandWindow.LogError(this.localization.format("InvalidIPErrorText", new object[]
         {
             parameter
         }));
         return;
     }
     if (Provider.isServer)
     {
         CommandWindow.LogError(this.localization.format("RunningErrorText"));
         return;
     }
     Provider.ip = Parser.getUInt32FromIP(parameter);
     CommandWindow.Log(this.localization.format("BindText", new object[]
     {
         parameter
     }));
 }
예제 #13
0
 protected override void execute(CSteamID executorID, string parameter)
 {
     if (!Dedicator.isDedicated)
     {
         return;
     }
     string[] componentsFromSerial = Parser.getComponentsFromSerial(parameter, '/');
     if (componentsFromSerial.Length > 1)
     {
         CommandWindow.LogError(this.localization.format("InvalidParameterErrorText"));
         return;
     }
     if (componentsFromSerial.Length == 0)
     {
         Provider.shutdown();
     }
     else
     {
         int timer;
         if (!int.TryParse(componentsFromSerial[0], out timer))
         {
             CommandWindow.LogError(this.localization.format("InvalidNumberErrorText", new object[]
             {
                 parameter
             }));
             return;
         }
         Provider.shutdown(timer);
         CommandWindow.LogError(this.localization.format("ShutdownText", new object[]
         {
             parameter
         }));
     }
 }
예제 #14
0
 protected override void execute(CSteamID executorID, string parameter)
 {
     if (!Dedicator.isDedicated)
     {
         return;
     }
     if (parameter.Length < (int)CommandName.MIN_LENGTH)
     {
         CommandWindow.LogError(this.localization.format("MinLengthErrorText", new object[]
         {
             CommandName.MIN_LENGTH
         }));
         return;
     }
     if (parameter.Length > (int)CommandName.MAX_LENGTH)
     {
         CommandWindow.LogError(this.localization.format("MaxLengthErrorText", new object[]
         {
             CommandName.MAX_LENGTH
         }));
         return;
     }
     Provider.serverName = parameter;
     CommandWindow.Log(this.localization.format("NameText", new object[]
     {
         parameter
     }));
 }
예제 #15
0
 // Token: 0x06001E03 RID: 7683 RVA: 0x000A32B0 File Offset: 0x000A16B0
 protected override void execute(CSteamID executorID, string parameter)
 {
     if (ModuleHook.modules.Count == 0)
     {
         CommandWindow.LogError(this.localization.format("NoModulesErrorText"));
         return;
     }
     CommandWindow.Log(this.localization.format("ModulesText"));
     CommandWindow.Log(this.localization.format("SeparatorText"));
     for (int i = 0; i < ModuleHook.modules.Count; i++)
     {
         Module module = ModuleHook.modules[i];
         if (module != null)
         {
             ModuleConfig config = module.config;
             if (config != null)
             {
                 Local local = Localization.tryRead(config.DirectoryPath, false);
                 CommandWindow.Log(local.format("Name"));
                 CommandWindow.Log(this.localization.format("Version", new object[]
                 {
                     config.Version
                 }));
                 CommandWindow.Log(local.format("Description"));
                 CommandWindow.Log(this.localization.format("SeparatorText"));
             }
         }
     }
 }
예제 #16
0
        protected override void execute(CSteamID executorID, string parameter)
        {
            string[] componentsFromSerial = Parser.getComponentsFromSerial(parameter, '/');
            if (componentsFromSerial.Length != 2)
            {
                CommandWindow.LogError(this.localization.format("InvalidParameterErrorText"));
                return;
            }
            uint num;

            if (!uint.TryParse(componentsFromSerial[0], out num))
            {
                CommandWindow.LogError(this.localization.format("InvalidNumberErrorText", new object[]
                {
                    parameter
                }));
                return;
            }
            uint num2;

            if (!uint.TryParse(componentsFromSerial[1], out num2))
            {
                CommandWindow.LogError(this.localization.format("InvalidNumberErrorText", new object[]
                {
                    parameter
                }));
                return;
            }
            CommandWindow.Log(this.localization.format("DecayText"));
        }
예제 #17
0
 // Token: 0x0600284A RID: 10314 RVA: 0x000F4490 File Offset: 0x000F2890
 private bool respawnItems()
 {
     if (Level.info == null || Level.info.type == ELevelType.ARENA)
     {
         return(false);
     }
     if (LevelItems.spawns[(int)ItemManager.respawnItems_X, (int)ItemManager.respawnItems_Y].Count > 0)
     {
         if (Time.realtimeSinceStartup - ItemManager.regions[(int)ItemManager.respawnItems_X, (int)ItemManager.respawnItems_Y].lastRespawn > Provider.modeConfigData.Items.Respawn_Time && (float)ItemManager.regions[(int)ItemManager.respawnItems_X, (int)ItemManager.respawnItems_Y].items.Count < (float)LevelItems.spawns[(int)ItemManager.respawnItems_X, (int)ItemManager.respawnItems_Y].Count * Provider.modeConfigData.Items.Spawn_Chance)
         {
             ItemManager.regions[(int)ItemManager.respawnItems_X, (int)ItemManager.respawnItems_Y].lastRespawn = Time.realtimeSinceStartup;
             ItemSpawnpoint itemSpawnpoint = LevelItems.spawns[(int)ItemManager.respawnItems_X, (int)ItemManager.respawnItems_Y][UnityEngine.Random.Range(0, LevelItems.spawns[(int)ItemManager.respawnItems_X, (int)ItemManager.respawnItems_Y].Count)];
             if (!SafezoneManager.checkPointValid(itemSpawnpoint.point))
             {
                 return(false);
             }
             ushort num = 0;
             while ((int)num < ItemManager.regions[(int)ItemManager.respawnItems_X, (int)ItemManager.respawnItems_Y].items.Count)
             {
                 if ((ItemManager.regions[(int)ItemManager.respawnItems_X, (int)ItemManager.respawnItems_Y].items[(int)num].point - itemSpawnpoint.point).sqrMagnitude < 4f)
                 {
                     return(false);
                 }
                 num += 1;
             }
             ushort    item      = LevelItems.getItem(itemSpawnpoint);
             ItemAsset itemAsset = (ItemAsset)Assets.find(EAssetType.ITEM, item);
             if (itemAsset != null)
             {
                 Item     item2    = new Item(item, EItemOrigin.WORLD);
                 ItemData itemData = new ItemData(item2, ItemManager.instanceCount += 1u, itemSpawnpoint.point, false);
                 ItemManager.regions[(int)ItemManager.respawnItems_X, (int)ItemManager.respawnItems_Y].items.Add(itemData);
                 ItemManager.manager.channel.send("tellItem", ESteamCall.CLIENTS, ESteamPacket.UPDATE_RELIABLE_BUFFER, new object[]
                 {
                     ItemManager.respawnItems_X,
                     ItemManager.respawnItems_Y,
                     item2.id,
                     item2.quality,
                     item2.state,
                     itemSpawnpoint.point,
                     itemData.instanceID
                 });
             }
             else
             {
                 CommandWindow.LogError(string.Concat(new object[]
                 {
                     "Failed to respawn an item with ID ",
                     item,
                     " from type ",
                     itemSpawnpoint.type,
                     "!"
                 }));
             }
         }
         return(false);
     }
     return(true);
 }
예제 #18
0
        // Token: 0x06001DCB RID: 7627 RVA: 0x000A0CA8 File Offset: 0x0009F0A8
        protected override void execute(CSteamID executorID, string parameter)
        {
            if (!Provider.isServer)
            {
                CommandWindow.LogError(this.localization.format("NotRunningErrorText"));
                return;
            }
            if (!Provider.hasCheats)
            {
                CommandWindow.LogError(this.localization.format("CheatsErrorText"));
                return;
            }
            string[] componentsFromSerial = Parser.getComponentsFromSerial(parameter, '/');
            if (componentsFromSerial.Length < 1 || componentsFromSerial.Length > 3)
            {
                CommandWindow.LogError(this.localization.format("InvalidParameterErrorText"));
                return;
            }
            bool        flag = false;
            SteamPlayer steamPlayer;

            if (!PlayerTool.tryGetSteamPlayer(componentsFromSerial[0], out steamPlayer))
            {
                steamPlayer = PlayerTool.getSteamPlayer(executorID);
                if (steamPlayer == null)
                {
                    CommandWindow.LogError(this.localization.format("NoPlayerErrorText", new object[]
                    {
                        componentsFromSerial[0]
                    }));
                    return;
                }
                flag = true;
            }
            ushort num;

            if (!ushort.TryParse(componentsFromSerial[(!flag) ? 1 : 0], out num))
            {
                CommandWindow.LogError(this.localization.format("InvalidAnimalIDErrorText", new object[]
                {
                    componentsFromSerial[(!flag) ? 1 : 0]
                }));
                return;
            }
            if (!AnimalManager.giveAnimal(steamPlayer.player, num))
            {
                CommandWindow.LogError(this.localization.format("NoAnimalIDErrorText", new object[]
                {
                    num
                }));
                return;
            }
            CommandWindow.Log(this.localization.format("AnimalText", new object[]
            {
                steamPlayer.playerID.playerName,
                num
            }));
        }
예제 #19
0
        protected override void execute(CSteamID executorID, string parameter)
        {
            string text = parameter.ToLower();

            if (text == this.localization.format("WeatherNone").ToLower())
            {
                if (LightingManager.hasRain && LevelLighting.rainyness == ELightingRain.DRIZZLE)
                {
                    LightingManager.rainDuration = 0u;
                }
                if (LightingManager.hasSnow && LevelLighting.snowyness == ELightingSnow.BLIZZARD)
                {
                    LightingManager.snowDuration = 0u;
                }
            }
            else if (text == this.localization.format("WeatherStorm").ToLower())
            {
                if (!LightingManager.hasRain)
                {
                    return;
                }
                if (LevelLighting.rainyness == ELightingRain.NONE)
                {
                    LightingManager.rainFrequency = 0u;
                }
                else if (LevelLighting.rainyness == ELightingRain.DRIZZLE)
                {
                    LightingManager.rainDuration = 0u;
                }
            }
            else
            {
                if (!(text == this.localization.format("WeatherBlizzard").ToLower()))
                {
                    CommandWindow.LogError(this.localization.format("NoWeatherErrorText", new object[]
                    {
                        text
                    }));
                    return;
                }
                if (!LightingManager.hasSnow)
                {
                    return;
                }
                if (LevelLighting.snowyness == ELightingSnow.NONE)
                {
                    LightingManager.snowFrequency = 0u;
                }
                else if (LevelLighting.snowyness == ELightingSnow.BLIZZARD)
                {
                    LightingManager.snowDuration = 0u;
                }
            }
            CommandWindow.Log(this.localization.format("WeatherText", new object[]
            {
                text
            }));
        }
예제 #20
0
        // Token: 0x06001E1F RID: 7711 RVA: 0x000A42E0 File Offset: 0x000A26E0
        protected override void execute(CSteamID executorID, string parameter)
        {
            if (!Provider.isServer)
            {
                CommandWindow.LogError(this.localization.format("NotRunningErrorText"));
                return;
            }
            if (!Provider.hasCheats)
            {
                CommandWindow.LogError(this.localization.format("CheatsErrorText"));
                return;
            }
            string[] componentsFromSerial = Parser.getComponentsFromSerial(parameter, '/');
            if (componentsFromSerial.Length < 1 || componentsFromSerial.Length > 2)
            {
                CommandWindow.LogError(this.localization.format("InvalidParameterErrorText"));
                return;
            }
            bool        flag = false;
            SteamPlayer steamPlayer;

            if (!PlayerTool.tryGetSteamPlayer(componentsFromSerial[0], out steamPlayer))
            {
                steamPlayer = PlayerTool.getSteamPlayer(executorID);
                if (steamPlayer == null)
                {
                    CommandWindow.LogError(this.localization.format("NoPlayerErrorText", new object[]
                    {
                        componentsFromSerial[0]
                    }));
                    return;
                }
                flag = true;
            }
            int num;

            if (!int.TryParse(componentsFromSerial[(!flag) ? 1 : 0], out num))
            {
                CommandWindow.LogError(this.localization.format("InvalidNumberErrorText", new object[]
                {
                    componentsFromSerial[(!flag) ? 1 : 0]
                }));
                return;
            }
            steamPlayer.player.skills.askRep(num);
            string text = num.ToString();

            if (num > 0)
            {
                text = '+' + text;
            }
            CommandWindow.Log(this.localization.format("ReputationText", new object[]
            {
                steamPlayer.playerID.playerName,
                text
            }));
        }
예제 #21
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
            }));
        }
예제 #22
0
 public int getCall(string name)
 {
     for (int i = 0; i < this.calls.Length; i++)
     {
         if (this.calls[i].method.Name == name)
         {
             return(i);
         }
     }
     CommandWindow.LogError("Failed to find a method named: " + name);
     return(-1);
 }
예제 #23
0
        // Token: 0x0600284B RID: 10315 RVA: 0x000F475C File Offset: 0x000F2B5C
        private void generateItems(byte x, byte y)
        {
            if (Level.info == null || Level.info.type == ELevelType.ARENA)
            {
                return;
            }
            List <ItemData> list = new List <ItemData>();

            if (LevelItems.spawns[(int)x, (int)y].Count > 0)
            {
                List <ItemSpawnpoint> list2 = new List <ItemSpawnpoint>();
                for (int i = 0; i < LevelItems.spawns[(int)x, (int)y].Count; i++)
                {
                    ItemSpawnpoint itemSpawnpoint = LevelItems.spawns[(int)x, (int)y][i];
                    if (SafezoneManager.checkPointValid(itemSpawnpoint.point))
                    {
                        list2.Add(itemSpawnpoint);
                    }
                }
                while ((float)list.Count < (float)LevelItems.spawns[(int)x, (int)y].Count * Provider.modeConfigData.Items.Spawn_Chance && list2.Count > 0)
                {
                    int            index           = UnityEngine.Random.Range(0, list2.Count);
                    ItemSpawnpoint itemSpawnpoint2 = list2[index];
                    list2.RemoveAt(index);
                    ushort    item      = LevelItems.getItem(itemSpawnpoint2);
                    ItemAsset itemAsset = (ItemAsset)Assets.find(EAssetType.ITEM, item);
                    if (itemAsset != null)
                    {
                        Item newItem = new Item(item, EItemOrigin.WORLD);
                        list.Add(new ItemData(newItem, ItemManager.instanceCount += 1u, itemSpawnpoint2.point, false));
                    }
                    else
                    {
                        CommandWindow.LogError(string.Concat(new object[]
                        {
                            "Failed to generate an item with ID ",
                            item,
                            " from type ",
                            itemSpawnpoint2.type,
                            "!"
                        }));
                    }
                }
            }
            for (int j = 0; j < ItemManager.regions[(int)x, (int)y].items.Count; j++)
            {
                if (ItemManager.regions[(int)x, (int)y].items[j].isDropped)
                {
                    list.Add(ItemManager.regions[(int)x, (int)y].items[j]);
                }
            }
            ItemManager.regions[(int)x, (int)y].items = list;
        }
예제 #24
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 != 4)
     {
         CommandWindow.LogError(this.localization.format("InvalidParameterErrorText"));
         return;
     }
     if (componentsFromSerial.Length == 1)
     {
         ChatManager.say(componentsFromSerial[0], Palette.SERVER);
     }
     else if (componentsFromSerial.Length == 4)
     {
         byte b;
         if (!byte.TryParse(componentsFromSerial[1], out b))
         {
             CommandWindow.LogError(this.localization.format("InvalidNumberErrorText", new object[]
             {
                 componentsFromSerial[0]
             }));
             return;
         }
         byte b2;
         if (!byte.TryParse(componentsFromSerial[2], out b2))
         {
             CommandWindow.LogError(this.localization.format("InvalidNumberErrorText", new object[]
             {
                 componentsFromSerial[1]
             }));
             return;
         }
         byte b3;
         if (!byte.TryParse(componentsFromSerial[3], out b3))
         {
             CommandWindow.LogError(this.localization.format("InvalidNumberErrorText", new object[]
             {
                 componentsFromSerial[2]
             }));
             return;
         }
         ChatManager.say(componentsFromSerial[0], new Color((float)b / 255f, (float)b2 / 255f, (float)b3 / 255f));
     }
 }
예제 #25
0
        private static void onInputText(string command)
        {
            bool flag = true;

            if (CommandWindow.onCommandWindowInputted != null)
            {
                CommandWindow.onCommandWindowInputted(command, ref flag);
            }
            if (flag && !Commander.execute(CSteamID.Nil, command))
            {
                CommandWindow.LogError("?");
            }
        }
예제 #26
0
 // Token: 0x06001E16 RID: 7702 RVA: 0x000A3C8C File Offset: 0x000A208C
 protected override void execute(CSteamID executorID, string parameter)
 {
     if (!Dedicator.isDedicated)
     {
         return;
     }
     if (Provider.isServer)
     {
         CommandWindow.LogError(this.localization.format("RunningErrorText"));
         return;
     }
     Provider.isPvP = false;
     CommandWindow.Log(this.localization.format("PvEText"));
 }
예제 #27
0
 // Token: 0x06001E2D RID: 7725 RVA: 0x000A4B48 File Offset: 0x000A2F48
 protected override void execute(CSteamID executorID, string parameter)
 {
     if (!Dedicator.isDedicated)
     {
         return;
     }
     if (Provider.isServer)
     {
         CommandWindow.LogError(this.localization.format("RunningErrorText"));
         return;
     }
     PlayerSavedata.hasSync = true;
     CommandWindow.Log(this.localization.format("SyncText"));
 }
예제 #28
0
 protected override void execute(CSteamID executorID, string parameter)
 {
     if (!Dedicator.isDedicated)
     {
         return;
     }
     if (Provider.isServer)
     {
         CommandWindow.LogError(this.localization.format("RunningErrorText"));
         return;
     }
     Provider.selectedGameModeName = parameter;
     CommandWindow.Log(this.localization.format("GameModeText", new object[]
     {
         parameter
     }));
 }
예제 #29
0
        // Token: 0x06001DF8 RID: 7672 RVA: 0x000A2B38 File Offset: 0x000A0F38
        protected override void execute(CSteamID executorID, string parameter)
        {
            string[] componentsFromSerial = Parser.getComponentsFromSerial(parameter, '/');
            if (componentsFromSerial.Length < 1)
            {
                CommandWindow.LogError(this.localization.format("InvalidParameterErrorText"));
                return;
            }
            byte b;

            if (!byte.TryParse(componentsFromSerial[0], out b) || (b != 255 && b > 10))
            {
                CommandWindow.LogError(this.localization.format("InvalidSkillsetIDErrorText", new object[]
                {
                    componentsFromSerial[0]
                }));
                return;
            }
            ushort[] array = new ushort[componentsFromSerial.Length - 1];
            for (int i = 1; i < componentsFromSerial.Length; i++)
            {
                ushort num;
                if (!ushort.TryParse(componentsFromSerial[i], out num))
                {
                    CommandWindow.LogError(this.localization.format("InvalidItemIDErrorText", new object[]
                    {
                        componentsFromSerial[i]
                    }));
                    return;
                }
                array[i - 1] = num;
            }
            if (b == 255)
            {
                PlayerInventory.loadout = array;
            }
            else
            {
                PlayerInventory.skillsets[(int)b] = array;
            }
            CommandWindow.Log(this.localization.format("LoadoutText", new object[]
            {
                b
            }));
        }
예제 #30
0
        // Token: 0x06001DFE RID: 7678 RVA: 0x000A2FDC File Offset: 0x000A13DC
        protected override void execute(CSteamID executorID, string parameter)
        {
            if (!Dedicator.isDedicated)
            {
                return;
            }
            byte b;

            if (!byte.TryParse(parameter, out b))
            {
                CommandWindow.LogError(this.localization.format("InvalidNumberErrorText", new object[]
                {
                    parameter
                }));
                return;
            }
            if (b < CommandMaxPlayers.MIN_NUMBER)
            {
                CommandWindow.LogError(this.localization.format("MinNumberErrorText", new object[]
                {
                    CommandMaxPlayers.MIN_NUMBER
                }));
                return;
            }
            if (b > CommandMaxPlayers.MAX_NUMBER)
            {
                CommandWindow.LogError(this.localization.format("MaxNumberErrorText", new object[]
                {
                    CommandMaxPlayers.MAX_NUMBER
                }));
                return;
            }
            if (b > CommandMaxPlayers.MAX_NUMBER / 2)
            {
                CommandWindow.LogWarning(this.localization.format("RecommendedNumberErrorText", new object[]
                {
                    (int)(CommandMaxPlayers.MAX_NUMBER / 2)
                }));
            }
            Provider.maxPlayers = b;
            CommandWindow.Log(this.localization.format("MaxPlayersText", new object[]
            {
                b
            }));
        }