Example #1
0
        void HandleGenerate(Player p, CountdownGame game, string x, string y, string z)
        {
            if (!CheckExtraPerm(p, 1))
            {
                return;
            }

            int width, height, length;

            if (!int.TryParse(x, out width) || !int.TryParse(y, out height) || !int.TryParse(z, out length))
            {
                width = 32; height = 32; length = 32;
            }
            if (width < 32 || !MapGen.OkayAxis(width))
            {
                width = 32;
            }
            if (height < 32 || !MapGen.OkayAxis(height))
            {
                height = 32;
            }
            if (length < 32 || !MapGen.OkayAxis(length))
            {
                length = 32;
            }

            if (!CmdNewLvl.CheckMapVolume(p, width, height, length))
            {
                return;
            }
            game.GenerateMap(p, width, height, length);
        }
Example #2
0
        protected override void HandleSet(Player p, RoundsGame game_, string[] args)
        {
            if (args.Length < 4)
            {
                Help(p); return;
            }
            if (game_.Running)
            {
                p.Message("You must stop Countdown before replacing the map."); return;
            }

            ushort x = 0, y = 0, z = 0;

            if (!MapGen.GetDimensions(p, args, 1, ref x, ref y, ref z))
            {
                return;
            }

            CountdownGame game = (CountdownGame)game_;

            game.GenerateMap(p, x, y, z);
        }