Ejemplo n.º 1
0
        protected override void OnGameLoaded()
        {
            var locked = (FSGameLoop.GetGameInstance(true) == null) || Game.GamemodeLoader.Gamemode.LockVars;

            DevConsole.LockFlags(locked, ConVarFlags.Replicator);
            DevConsole.LockFlags(locked, ConVarFlags.Cheat);
            DevConsole.LockFlags(locked, ConVarFlags.Gamemode);
        }
Ejemplo n.º 2
0
        protected override void OnPlayerPacketReceived(IPlayer player, IBasePacket packet)
        {
            if (Game.IsHost ||
                FSGameLoop.GetGameInstance(true) != null ||
                !(packet is CustomPacket cp && cp.Label == "Replicate"))
            {
                return;
            }

            var replStr = cp.GetString(0);
            var cmds    = replStr.Split('&');

            if (cmds != null && cmds.Length > 0)
            {
                foreach (var cmd in cmds)
                {
                    DevConsole.ExecuteLine(cmd);
                }
            }
        }