Exemple #1
0
        public string SerializeFCMv2()
        {
            string xheader;

            if (CreatedBy != null)
            {
                xheader = CreatedBy.Name + " " + CreatedDate.ToCompactString() + " ";
            }
            else
            {
                xheader = "- - ";
            }

            if (EditedBy != null)
            {
                xheader += EditedBy.Name + " " + EditedDate.ToCompactString();
            }
            else
            {
                xheader += "- -";
            }

            SecurityController.PlayerListCollection list = Controller.ExceptionList;

            return(String.Format("{0},{1},{2},{3}",
                                 String.Format("{0} {1} {2} {3} {4} {5} {6} {7}",
                                               Name, Bounds.XMin, Bounds.YMin, Bounds.HMin, Bounds.XMax, Bounds.YMax, Bounds.HMax, Controller.MinRank.GetFullName()),
                                 list.Included.JoinToString(" ", p => p.Name),
                                 list.Excluded.JoinToString(" ", p => p.Name),
                                 xheader));
        }
Exemple #2
0
        internal static void ZoneInfo(Player player, Command cmd)
        {
            string zoneName = cmd.Next();

            if (zoneName == null)
            {
                player.Message("No zone name specified. See &H/help zinfo");
                return;
            }

            Zone zone = player.World.Map.FindZone(zoneName);

            if (zone == null)
            {
                player.Message("No zone found with the name \"{0}\". See &H/zones", zoneName);
                return;
            }

            player.Message("About zone \"{0}\": size {1} x {2} x {3}, contains {4} blocks, editable by {5}+.",
                           zone.Name,
                           zone.Bounds.WidthX, zone.Bounds.WidthY, zone.Bounds.Height,
                           zone.Bounds.Volume,
                           zone.Controller.MinRank.GetClassyName());

            player.Message("  Zone centre is at ({0},{1},{2}).",
                           (zone.Bounds.XMin + zone.Bounds.XMax) / 2,
                           (zone.Bounds.YMin + zone.Bounds.YMax) / 2,
                           (zone.Bounds.HMin + zone.Bounds.HMax) / 2);

            if (zone.CreatedBy != null)
            {
                player.Message("  Zone created by {0}&S on {1:MMM d} at {1:h:mm} ({2}d {3}h ago).",
                               zone.CreatedBy.GetClassyName(),
                               zone.CreatedDate,
                               DateTime.UtcNow.Subtract(zone.CreatedDate).Days,
                               DateTime.UtcNow.Subtract(zone.CreatedDate).Hours);
            }

            if (zone.EditedBy != null)
            {
                player.Message("  Zone last edited by {0}&S on {1:MMM d} at {1:h:mm} ({2}d {3}h ago).",
                               zone.EditedBy.GetClassyName(),
                               zone.EditedDate,
                               DateTime.UtcNow.Subtract(zone.EditedDate).Days,
                               DateTime.UtcNow.Subtract(zone.EditedDate).Hours);
            }

            SecurityController.PlayerListCollection playerList = zone.GetPlayerList();

            if (playerList.Included.Length > 0)
            {
                player.Message("  Zone whitelist includes: {0}",
                               playerList.Included.JoinToClassyString());
            }

            if (playerList.Excluded.Length > 0)
            {
                player.Message("  Zone blacklist excludes: {0}",
                               playerList.Excluded.JoinToClassyString());
            }
        }