Esempio n. 1
0
        public override void Use(Player p, string message)
        {
            string[] args = message.Split(' ');
            string   level;
            bool     env = args[0].CaselessEq("env");

            level = env ? (args.Length > 1 ? args[1] : "") : args[0];

            Level       lvl  = level == "" ? p.level : LevelInfo.Find(level);
            MapInfoData data = new MapInfoData();

            if (lvl != null)
            {
                data.FromOnlineLevel(lvl);
            }
            else
            {
                string map = LevelInfo.FindMapMatches(p, level);
                if (map == null)
                {
                    return;
                }
                data.FromOfflineLevel(map);
            }

            if (env)
            {
                ShowEnv(p, data);
            }
            else
            {
                ShowNormal(p, data);
            }
        }
Esempio n. 2
0
        bool GetFromMap(Player p, MapInfoData data, string map)
        {
            map = Matcher.FindMaps(p, map);
            if (map == null)
            {
                return(false);
            }

            Level lvl = LevelInfo.FindExact(map);

            if (lvl != null)
            {
                data.FromOnlineLevel(lvl);
            }
            else
            {
                data.FromOfflineLevel(map);
            }
            return(true);
        }
Esempio n. 3
0
        public override void Use(Player p, string message)
        {
            string[] args = message.Split(' ');
            string   level;
            bool     env = args[0].CaselessEq("env");

            level = env ? (args.Length > 1 ? args[1] : "") : args[0];
            bool perms = args[0].CaselessEq("perms");

            level = perms ? (args.Length > 1 ? args[1] : "") : args[0];

            Level       lvl  = level == "" ? p.level : LevelInfo.Find(level);
            MapInfoData data = new MapInfoData();

            if (lvl != null)
            {
                data.FromOnlineLevel(lvl);
            }
            else if (LevelInfo.ExistsOffline(level))
            {
                data.FromOfflineLevel(level);
            }
            else
            {
                Player.SendMessage(p, "Could not find specified level."); return;
            }

            if (env)
            {
                ShowEnv(p, data);
            }
            else if (perms)
            {
                ShowPermissions(p, data);
            }
            else
            {
                ShowNormal(p, data);
            }
        }
Esempio n. 4
0
        public override void Use(Player p, string message)
        {
            Level       lvl  = message == "" ? p.level : LevelInfo.Find(message);
            MapInfoData data = new MapInfoData();

            if (lvl != null)
            {
                data.FromOnlineLevel(lvl);
            }
            else if (LevelInfo.ExistsOffline(message))
            {
                data.FromOfflineLevel(message);
            }
            else
            {
                Player.SendMessage(p, "Could not find specified level."); return;
            }

            Player.SendMessage(p, "&b" + data.name + "%S: Width=" + data.Width + " Height=" + data.Height + " Depth=" + data.Length);
            string physicsState = CmdPhysics.states[data.physics];

            Player.SendMessage(p, "Physics are " + physicsState + Server.DefaultColor + " on &b" + data.name);

            Player.SendMessage(p, "Build rank = " + Group.findPerm(data.build).color + Group.findPerm(data.build).trueName +
                               " %S: Visit rank = " + Group.findPerm(data.visit).color + Group.findPerm(data.visit).trueName);

            Player.SendMessage(p, "BuildMax Rank = " + Group.findPerm(data.buildmax).color + Group.findPerm(data.buildmax).trueName +
                               " %S: VisitMax Rank = " + Group.findPerm(data.visitmax).color + Group.findPerm(data.visitmax).trueName);

            string gunStatus = data.guns ? "&aonline" : "&coffline";

            Player.SendMessage(p, "&cGuns &eare " + gunStatus + " &eon " + data.name + ".");

            if (Directory.Exists(Server.backupLocation + "/" + data.name))
            {
                int      latestBackup = Directory.GetDirectories(Server.backupLocation + "/" + data.name).Length;
                DateTime time         = Directory.GetCreationTime(LevelInfo.BackupPath(data.name, latestBackup.ToString()));
                Player.SendMessage(p, "Latest backup: &a" + latestBackup + " %Sat &a" + time.ToString("yyyy-MM-dd HH:mm:ss"));
            }
            else
            {
                Player.SendMessage(p, "No backups for this map exist yet.");
            }

            if (data.terrainUrl != "")
            {
                Player.SendMessage(p, "TexturePack: %b" + data.terrainUrl);
            }
            else
            {
                Player.SendMessage(p, "No textures for this map exist yet.");
            }

            const string format = "Colors: Fog {0}, Sky {1}, Clouds {2}, Sunlight {3}, Shadowlight {4}";

            Player.SendMessage(p, String.Format(format, Color(data.Fog), Color(data.Sky), Color(data.Clouds),
                                                Color(data.Light), Color(data.Shadow)));

            Player.SendMessage(p, "Water Level: %b" + data.EdgeLevel + "%S, Clouds height: %b" + data.CloudsHeight
                               + "%S, Max fog distance: %b" + data.MaxFogDistance);
            Player.SendMessage(p, "Edge Block: %b" + data.EdgeBlock + "%S, Horizon Block: %b" + data.HorizonBlock);
        }