Ejemplo n.º 1
0
        private void ShowNpcsCommand(List <string> args, Main.Common.CmdIO.TTY io, UUID limitedToScene)
        {
            if (args[0] == "help")
            {
                io.Write("show npcs - Shows all NPCs in region");
                return;
            }
            UUID selectedScene = io.SelectedScene;

            if (limitedToScene != UUID.Zero)
            {
                selectedScene = limitedToScene;
            }

            SceneInterface scene;

            if (!m_KnownScenes.TryGetValue(selectedScene, out scene))
            {
                io.Write("No region selected");
            }
            else
            {
                var sb = new StringBuilder("NPCs:\n----------------------------------------------\n");
                foreach (NpcAgent agent in m_NpcAgents.Values)
                {
                    if (agent.CurrentScene != scene)
                    {
                        continue;
                    }
                    UGUIWithName npcOwner = m_AdminWebIF.ResolveName(agent.NpcOwner);
                    sb.AppendFormat("Npc {0} {1} ({2})\n- Owner: {3}\n", agent.NamedOwner.FirstName, agent.NamedOwner.LastName, agent.NamedOwner.ID.ToString(), npcOwner.FullName);
                    if (m_NpcPresenceService != null && m_NpcPresenceService[agent.Owner.ID].Count != 0)
                    {
                        sb.AppendFormat("- Persistent NPC\n");
                    }
                }
                io.Write(sb.ToString());
            }
        }
Ejemplo n.º 2
0
 public static Map ToJsonMap(this EstateInfo estate, IAdminWebIF webif) => new Map
 {
     { "ID", (int)estate.ID },
     { "ParentEstateID", (int)estate.ParentEstateID },
     { "Name", estate.Name },
     { "Flags", ((uint)estate.Flags).ToString() },
     { "Owner", webif.ResolveName(estate.Owner).ToMap() },
     { "PricePerMeter", estate.PricePerMeter },
     { "BillableFactor", estate.BillableFactor },
     { "SunPosition", estate.SunPosition },
     { "AbuseEmail", estate.AbuseEmail },
     { "UseGlobalTime", estate.UseGlobalTime }
 };
Ejemplo n.º 3
0
        private void ReturnRegionsResult(HttpRequest req, List <RegionInfo> regions)
        {
            var resdata = new Map();

            foreach (var ri in regions)
            {
                var owner      = m_WebIF.ResolveName(ri.Owner);
                var regiondata = new Map
                {
                    { "name", ri.Name },
                    { "location_x", ri.Location.GridX },
                    { "location_y", ri.Location.GridY },
                    { "size_x", ri.Size.GridX },
                    { "size_y", ri.Size.GridY },
                    { "owner", owner.ToString() },
                    { "flags", (int)ri.Flags }
                };
                resdata.Add(ri.ID.ToString(), regiondata);
            }

            m_WebIF.SuccessResponse(req, resdata);
        }
Ejemplo n.º 4
0
        public static Map ToJsonMap(this RegionInfo region, IAdminWebIF webif)
        {
            var m = new Map
            {
                { "ID", region.ID },
                { "Location", region.Location.GridLocation },
                { "Size", region.Size.GridLocation },
                { "Name", region.Name },
                { "ServerIP", region.ServerIP },
                { "ServerHttpPort", (int)region.ServerHttpPort },
                { "ServerURI", region.ServerURI },
                { "ServerPort", (int)region.ServerPort },
                { "RegionMapTexture", region.ParcelMapTexture.ToString() },
                { "ProductName", region.ProductName }
            };

            switch (region.Access)
            {
            case RegionAccess.PG:
                m.Add("Access", "pg");
                break;

            case RegionAccess.Mature:
                m.Add("Access", "mature");
                break;

            case RegionAccess.Adult:
                m.Add("Access", "adult");
                break;

            default:
                m.Add("Access", "unknown");
                break;
            }

            m.Add("Owner", webif.ResolveName(region.Owner).ToMap());
            m.Add("Flags", ((uint)region.Flags).ToString());
            return(m);
        }