Esempio n. 1
0
        protected void HandleShowGridUser(string module, string[] cmdparams)
        {
            if (cmdparams.Length != 4)
            {
                MainConsole.Instance.Output("Usage: show grid user <UUID>");
                return;
            }

            GridUserData[] data = m_Database.GetAll(cmdparams[3]);

            foreach (GridUserData gu in data)
            {
                ConsoleDisplayList cdl = new ConsoleDisplayList();

                cdl.AddRow("User ID", gu.UserID);

                foreach (KeyValuePair<string,string> kvp in gu.Data)
                    cdl.AddRow(kvp.Key, kvp.Value);

                MainConsole.Instance.Output(cdl.ToString());
            }

            MainConsole.Instance.OutputFormat("Entries: {0}", data.Length);
        }
        private void AppendParcelReport(StringBuilder report, ILandObject lo)
        {
            LandData ld = lo.LandData;

            ConsoleDisplayList cdl = new ConsoleDisplayList();
            cdl.AddRow("Parcel name", ld.Name);
            cdl.AddRow("Local ID", ld.LocalID);
            cdl.AddRow("Description", ld.Description);
            cdl.AddRow("Snapshot ID", ld.SnapshotID);
            cdl.AddRow("Area", ld.Area);
            cdl.AddRow("Starts", lo.StartPoint);
            cdl.AddRow("Ends", lo.EndPoint);
            cdl.AddRow("AABB Min", ld.AABBMin);
            cdl.AddRow("AABB Max", ld.AABBMax);
            string ownerName;
            if (ld.IsGroupOwned)
            {
                GroupRecord rec = m_groupManager.GetGroupRecord(ld.GroupID);
                ownerName = (rec != null) ? rec.GroupName : "Unknown Group";
            }
            else
            {
                ownerName = m_userManager.GetUserName(ld.OwnerID);
            }
            cdl.AddRow("Owner", ownerName);
            cdl.AddRow("Is group owned?", ld.IsGroupOwned);
            cdl.AddRow("GroupID", ld.GroupID);

            cdl.AddRow("Status", ld.Status);
            cdl.AddRow("Flags", (ParcelFlags)ld.Flags);           

            cdl.AddRow("Landing Type", (LandingType)ld.LandingType);
            cdl.AddRow("User Location", ld.UserLocation);
            cdl.AddRow("User look at", ld.UserLookAt);

            cdl.AddRow("Other clean time", ld.OtherCleanTime);

            cdl.AddRow("Max Prims", lo.GetParcelMaxPrimCount());
            IPrimCounts pc = lo.PrimCounts;
            cdl.AddRow("Owner Prims", pc.Owner);
            cdl.AddRow("Group Prims", pc.Group);
            cdl.AddRow("Other Prims", pc.Others);
            cdl.AddRow("Selected Prims", pc.Selected);
            cdl.AddRow("Total Prims", pc.Total);

            cdl.AddRow("Music URL", ld.MusicURL);
            cdl.AddRow("Obscure Music", ld.ObscureMusic);

            cdl.AddRow("Media ID", ld.MediaID);
            cdl.AddRow("Media Autoscale", Convert.ToBoolean(ld.MediaAutoScale));
            cdl.AddRow("Media URL", ld.MediaURL);
            cdl.AddRow("Media Type", ld.MediaType);
            cdl.AddRow("Media Description", ld.MediaDescription);
            cdl.AddRow("Media Width", ld.MediaWidth);
            cdl.AddRow("Media Height", ld.MediaHeight);
            cdl.AddRow("Media Loop", ld.MediaLoop);
            cdl.AddRow("Obscure Media", ld.ObscureMedia);

            cdl.AddRow("Parcel Category", ld.Category);

            cdl.AddRow("Claim Date", ld.ClaimDate);
            cdl.AddRow("Claim Price", ld.ClaimPrice);
            cdl.AddRow("Pass Hours", ld.PassHours);
            cdl.AddRow("Pass Price", ld.PassPrice);

            cdl.AddRow("Auction ID", ld.AuctionID);
            cdl.AddRow("Authorized Buyer ID", ld.AuthBuyerID);
            cdl.AddRow("Sale Price", ld.SalePrice);

            cdl.AddToStringBuilder(report);
        }
        private void OutputSceneDebugOptions()
        {
            ConsoleDisplayList cdl = new ConsoleDisplayList();
            cdl.AddRow("active", m_scene.Active);
            cdl.AddRow("animations", m_scene.DebugAnimations);
            cdl.AddRow("pbackup", m_scene.PeriodicBackup);
            cdl.AddRow("physics", m_scene.PhysicsEnabled);
            cdl.AddRow("scripting", m_scene.ScriptsEnabled);
            cdl.AddRow("teleport", m_scene.DebugTeleporting);
            cdl.AddRow("updates", m_scene.DebugUpdates);

            MainConsole.Instance.OutputFormat("Scene {0} options:", m_scene.Name);
            MainConsole.Instance.Output(cdl.ToString());
        }
Esempio n. 4
0
        private void HandleShowRegion(string module, string[] cmd)
        {
            if (cmd.Length != 3)
            {
                MainConsole.Instance.Output("Syntax: show region <region name>");
                return;
            }
            List<RegionData> regions = m_Database.Get(cmd[2], UUID.Zero);
            if (regions == null || regions.Count < 1)
            {
                MainConsole.Instance.Output("Region not found");
                return;
            }

            foreach (RegionData r in regions)
            {
                OpenSim.Data.RegionFlags flags = (OpenSim.Data.RegionFlags)Convert.ToInt32(r.Data["flags"]);

                ConsoleDisplayList dispList = new ConsoleDisplayList();
                dispList.AddRow("Region Name", r.RegionName);
                dispList.AddRow("Region ID", r.RegionID);
                dispList.AddRow("Location", string.Format("{0},{1}", r.coordX, r.coordY));
                dispList.AddRow("URI", r.Data["serverURI"]);
                dispList.AddRow("Owner ID", r.Data["owner_uuid"]);
                dispList.AddRow("Flags", flags);

                MainConsole.Instance.Output(dispList.ToString());
            }

            return;
        }
Esempio n. 5
0
        private StringBuilder AddSummarySceneObjectReport(StringBuilder sb, SceneObjectGroup so)
        {
            ConsoleDisplayList cdl = new ConsoleDisplayList();
            cdl.AddRow("Name", so.Name);
            cdl.AddRow("Descrition", so.Description);
            cdl.AddRow("Local ID", so.LocalId);
            cdl.AddRow("UUID", so.UUID);
            cdl.AddRow("Location", string.Format("{0} @ {1}", so.AbsolutePosition, so.Scene.Name));
            cdl.AddRow("Parts", so.PrimCount);
            cdl.AddRow("Flags", so.RootPart.Flags);

            return sb.Append(cdl.ToString());
        }
Esempio n. 6
0
        private void HandleShowBotsStatus(string module, string[] cmd)
        {
            ConsoleDisplayTable cdt = new ConsoleDisplayTable();
            cdt.AddColumn("Name", 24);
            cdt.AddColumn("Region", 24);
            cdt.AddColumn("Status", 13);
            cdt.AddColumn("Conns", 5);
            cdt.AddColumn("Behaviours", 20);

            Dictionary<ConnectionState, int> totals = new Dictionary<ConnectionState, int>();
            foreach (object o in Enum.GetValues(typeof(ConnectionState)))
                totals[(ConnectionState)o] = 0;

            lock (m_bots)
            {
                foreach (Bot bot in m_bots)
                {
                    Simulator currentSim = bot.Client.Network.CurrentSim;
                    totals[bot.ConnectionState]++;

                    cdt.AddRow(
                        bot.Name, 
                        currentSim != null ? currentSim.Name : "(none)", 
                        bot.ConnectionState, 
                        bot.SimulatorsCount, 
                        string.Join(",", bot.Behaviours.Keys.ToArray()));
                }
            }

            MainConsole.Instance.Output(cdt.ToString());

            ConsoleDisplayList cdl = new ConsoleDisplayList();

            foreach (KeyValuePair<ConnectionState, int> kvp in totals)
                cdl.AddRow(kvp.Key, kvp.Value);

            MainConsole.Instance.Output(cdl.ToString());
        }
Esempio n. 7
0
        private void OutputRegionToConsole(RegionData r)
        {
            OpenSim.Data.RegionFlags flags = (OpenSim.Data.RegionFlags)Convert.ToInt32(r.Data["flags"]);

            ConsoleDisplayList dispList = new ConsoleDisplayList();
            dispList.AddRow("Region Name", r.RegionName);
            dispList.AddRow("Region ID", r.RegionID);
            dispList.AddRow("Location", string.Format("{0},{1}", r.coordX, r.coordY));
            dispList.AddRow("URI", r.Data["serverURI"]);
            dispList.AddRow("Owner ID", r.Data["owner_uuid"]);
            dispList.AddRow("Flags", flags);

            MainConsole.Instance.Output(dispList.ToString());
        }
Esempio n. 8
0
        private void HandleShowServerThrottlesCommand(string module, string[] args)
        {
            if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)
                return;

            m_console.OutputFormat("Throttles for {0}", m_udpServer.Scene.Name);
            ConsoleDisplayList cdl = new ConsoleDisplayList();
            cdl.AddRow("Adaptive throttles", m_udpServer.ThrottleRates.AdaptiveThrottlesEnabled);

            long maxSceneDripRate = (long)m_udpServer.Throttle.MaxDripRate;
            cdl.AddRow(
                "Max scene throttle", 
                maxSceneDripRate != 0 ? string.Format("{0} kbps", maxSceneDripRate * 8 / 1000) : "unset");

            int maxClientDripRate = m_udpServer.ThrottleRates.Total;
            cdl.AddRow(
                "Max new client throttle", 
                maxClientDripRate != 0 ? string.Format("{0} kbps", maxClientDripRate * 8 / 1000) : "unset");

            m_console.Output(cdl.ToString());

            m_console.OutputFormat("{0}\n", GetServerThrottlesReport(m_udpServer));
        }
        private void HandleCheckWearablesCommand(string module, string[] cmd)
        {
            if (cmd.Length != 4)
            {
                MainConsole.Instance.OutputFormat("Usage: wearables check <first-name> <last-name>");
                return;
            }

            string firstname = cmd[2];
            string lastname = cmd[3];

            StringBuilder sb = new StringBuilder();
            UuidGatherer uuidGatherer = new UuidGatherer(m_scenes[0].AssetService);

            lock (m_scenes)
            {
                foreach (Scene scene in m_scenes)
                {
                    ScenePresence sp = scene.GetScenePresence(firstname, lastname);
                    if (sp != null && !sp.IsChildAgent)
                    {
                        sb.AppendFormat("Wearables checks for {0}\n\n", sp.Name);

                        for (int i = (int)WearableType.Shape; i < (int)WearableType.Physics; i++)
                        {
                            AvatarWearable aw = sp.Appearance.Wearables[i];

                            if (aw.Count > 0)
                            {
                                sb.Append(Enum.GetName(typeof(WearableType), i));
                                sb.Append("\n");

                                for (int j = 0; j < aw.Count; j++)
                                {
                                    WearableItem wi = aw[j];

                                    ConsoleDisplayList cdl = new ConsoleDisplayList();
                                    cdl.Indent = 2;
                                    cdl.AddRow("Item UUID", wi.ItemID);
                                    cdl.AddRow("Assets", "");
                                    sb.Append(cdl.ToString());

                                    uuidGatherer.AddForInspection(wi.AssetID);
                                    uuidGatherer.GatherAll();
                                    string[] assetStrings 
                                        = Array.ConvertAll<UUID, string>(uuidGatherer.GatheredUuids.Keys.ToArray(), u => u.ToString());

                                    bool[] existChecks = scene.AssetService.AssetsExist(assetStrings);

                                    ConsoleDisplayTable cdt = new ConsoleDisplayTable();
                                    cdt.Indent = 4;
                                    cdt.AddColumn("Type", 10);
                                    cdt.AddColumn("UUID", ConsoleDisplayUtil.UuidSize);
                                    cdt.AddColumn("Found", 5);
                                            
                                    for (int k = 0; k < existChecks.Length; k++)
                                        cdt.AddRow(
                                            (AssetType)uuidGatherer.GatheredUuids[new UUID(assetStrings[k])], 
                                            assetStrings[k], existChecks[k] ? "yes" : "no");

                                    sb.Append(cdt.ToString());
                                    sb.Append("\n");
                                }
                            }
                        }
                    }
                }
            }

            MainConsole.Instance.Output(sb.ToString());
        }
Esempio n. 10
0
        private void OutputSceneDebugOptions()
        {
            ConsoleDisplayList cdl = new ConsoleDisplayList();
            cdl.AddRow("active", m_scene.Active);
            cdl.AddRow("animations", m_scene.DebugAnimations);
            cdl.AddRow("appear-refresh", m_scene.SendPeriodicAppearanceUpdates);
            cdl.AddRow("child-repri", m_scene.ChildReprioritizationDistance);
            cdl.AddRow("client-pos-upd", m_scene.RootPositionUpdateTolerance);
            cdl.AddRow("client-rot-upd", m_scene.RootRotationUpdateTolerance);
            cdl.AddRow("client-vel-upd", m_scene.RootVelocityUpdateTolerance);
            cdl.AddRow("root-upd-per", m_scene.RootTerseUpdatePeriod);
            cdl.AddRow("child-upd-per", m_scene.ChildTerseUpdatePeriod);
            cdl.AddRow("pbackup", m_scene.PeriodicBackup);
            cdl.AddRow("physics", m_scene.PhysicsEnabled);
            cdl.AddRow("scripting", m_scene.ScriptsEnabled);
            cdl.AddRow("teleport", m_scene.DebugTeleporting);
//            cdl.AddRow("update-on-timer", m_scene.UpdateOnTimer);
            cdl.AddRow("updates", m_scene.DebugUpdates);

            MainConsole.Instance.OutputFormat("Scene {0} options:", m_scene.Name);
            MainConsole.Instance.Output(cdl.ToString());
        }
        private void GetAttachmentsReport(ScenePresence sp, StringBuilder sb)
        {
            sb.AppendFormat("Animations for {0}\n", sp.Name);

            ConsoleDisplayList cdl = new ConsoleDisplayList() { Indent = 2 };
            ScenePresenceAnimator spa = sp.Animator;
            AnimationSet anims = sp.Animator.Animations;

            string cma = spa.CurrentMovementAnimation;
            cdl.AddRow(
                "Current movement anim", 
                string.Format("{0}, {1}", DefaultAvatarAnimations.GetDefaultAnimation(cma), cma));

            UUID defaultAnimId = anims.DefaultAnimation.AnimID;
            cdl.AddRow(
                "Default anim", 
                string.Format("{0}, {1}", defaultAnimId, sp.Animator.GetAnimName(defaultAnimId)));

            UUID implicitDefaultAnimId = anims.ImplicitDefaultAnimation.AnimID;
            cdl.AddRow(
                "Implicit default anim", 
                string.Format("{0}, {1}", 
                    implicitDefaultAnimId, sp.Animator.GetAnimName(implicitDefaultAnimId)));

            cdl.AddToStringBuilder(sb);

            ConsoleDisplayTable cdt = new ConsoleDisplayTable() { Indent = 2 };
            cdt.AddColumn("Animation ID", 36);
            cdt.AddColumn("Name", 20);
            cdt.AddColumn("Seq", 3);
            cdt.AddColumn("Object ID", 36);

            UUID[] animIds;
            int[] sequenceNumbers;
            UUID[] objectIds;

            sp.Animator.Animations.GetArrays(out animIds, out sequenceNumbers, out objectIds);

            for (int i = 0; i < animIds.Length; i++)
            {
                UUID animId = animIds[i];
                string animName = sp.Animator.GetAnimName(animId);
                int seq = sequenceNumbers[i];
                UUID objectId = objectIds[i];

                cdt.AddRow(animId, animName, seq, objectId);
            }

            cdt.AddToStringBuilder(sb);
            sb.Append("\n");
        }
Esempio n. 12
0
        /// <summary>
        /// Append a scene object part report to an input StringBuilder
        /// </summary>
        /// <returns></returns>
        /// <param name='sb'></param>
        /// <param name='sop'</param>
        /// <param name='showFull'>
        /// If true then information on each inventory item will be shown.
        /// If false then only summary inventory information is shown.
        /// </param>
        private StringBuilder AddScenePartReport(StringBuilder sb, SceneObjectPart sop, bool showFull)
        {
            ConsoleDisplayList cdl = new ConsoleDisplayList();
            cdl.AddRow("Name", sop.Name);
            cdl.AddRow("Description", sop.Description);
            cdl.AddRow("Local ID", sop.LocalId);
            cdl.AddRow("UUID", sop.UUID);
            cdl.AddRow("Location",  string.Format("{0} @ {1}", sop.AbsolutePosition, sop.ParentGroup.Scene.Name));
            cdl.AddRow(
                "Parent",
                sop.IsRoot ? "Is Root" : string.Format("{0} {1}", sop.ParentGroup.Name, sop.ParentGroup.UUID));
            cdl.AddRow("Link number", sop.LinkNum);
            cdl.AddRow("Flags", sop.Flags);

            object itemsOutput;
            if (showFull)
            {
                StringBuilder itemsSb = new StringBuilder("\n");
                itemsOutput = AddScenePartItemsReport(itemsSb, sop.Inventory).ToString();
            }
            else
            {
                itemsOutput = sop.Inventory.Count;
            }


            cdl.AddRow("Items", itemsOutput);

            return sb.Append(cdl.ToString());
        }
Esempio n. 13
0
        private void HandleClientGetCommand(string module, string[] args)
        {
            if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)
                return;

            if (args.Length != 4 && args.Length != 6)
            {
                MainConsole.Instance.OutputFormat("Usage: debug lludp client get [<avatar-first-name> <avatar-last-name>]");
                return;
            }

            string name = null;

            if (args.Length == 6)
                name = string.Format("{0} {1}", args[4], args[5]);

            m_udpServer.Scene.ForEachScenePresence(
                sp =>
                {
                    if ((name == null || sp.Name == name) && sp.ControllingClient is LLClientView)
                    {
                        LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient;

                        m_console.OutputFormat(
                            "Client debug parameters for {0} ({1}) in {2}",
                            sp.Name, sp.IsChildAgent ? "child" : "root", m_udpServer.Scene.Name);

                        ConsoleDisplayList cdl = new ConsoleDisplayList();
                        cdl.AddRow("process-unacked-sends", udpClient.ProcessUnackedSends);

                        m_console.Output(cdl.ToString());
                    }
                });
        }
Esempio n. 14
0
        private void HandleShowThreadpoolCallsActive(string module, string[] args)
        {
            List<KeyValuePair<string, int>> calls = Util.GetFireAndForgetCallsInProgress().ToList();
            calls.Sort((kvp1, kvp2) => kvp2.Value.CompareTo(kvp1.Value));
            int namedCalls = 0;

            ConsoleDisplayList cdl = new ConsoleDisplayList();
            foreach (KeyValuePair<string, int> kvp in calls)
            {
                if (kvp.Value > 0)
                {
                    cdl.AddRow(kvp.Key, kvp.Value);
                    namedCalls += kvp.Value;
                }
            }

            cdl.AddRow("TOTAL NAMED", namedCalls);

            long allQueuedCalls = Util.TotalQueuedFireAndForgetCalls;
            long allRunningCalls = Util.TotalRunningFireAndForgetCalls;

            cdl.AddRow("TOTAL QUEUED", allQueuedCalls);
            cdl.AddRow("TOTAL RUNNING", allRunningCalls);
            cdl.AddRow("TOTAL ANONYMOUS", allQueuedCalls + allRunningCalls - namedCalls);
            cdl.AddRow("TOTAL ALL", allQueuedCalls + allRunningCalls);

            MainConsole.Instance.Output(cdl.ToString());
        }
Esempio n. 15
0
        private void HandleThrottleGetCommand(string module, string[] args)
        {
            if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)
                return;

            bool all = args.Length == 4;
            bool one = args.Length == 6;

            if (!all && !one)
            {
                MainConsole.Instance.OutputFormat(
                    "Usage: debug lludp throttles get [<avatar-first-name> <avatar-last-name>]");
                return;
            }           

            string firstName = null;
            string lastName = null;

            if (one)
            {
                firstName = args[4];
                lastName = args[5];
            }

            m_udpServer.Scene.ForEachScenePresence(sp =>
             {
                if (all || (sp.Firstname == firstName && sp.Lastname == lastName))
                {
                    m_console.OutputFormat(
                        "Status for {0} ({1}) in {2}",
                        sp.Name, sp.IsChildAgent ? "child" : "root", m_udpServer.Scene.Name);

                    LLUDPClient udpClient = ((LLClientView)sp.ControllingClient).UDPClient;

                    ConsoleDisplayList cdl = new ConsoleDisplayList();
                    cdl.AddRow("adaptive", udpClient.FlowThrottle.AdaptiveEnabled);
                    cdl.AddRow("current", string.Format("{0} kbps", udpClient.FlowThrottle.DripRate * 8 / 1000));
                    cdl.AddRow("request", string.Format("{0} kbps", udpClient.FlowThrottle.RequestedDripRate * 8 / 1000));  
                    cdl.AddRow("max", string.Format("{0} kbps", udpClient.FlowThrottle.MaxDripRate * 8 / 1000));

                    m_console.Output(cdl.ToString());
                }
            });
        }
Esempio n. 16
0
        private void HandleShowThreadpoolCallsComplete(string module, string[] args)
        {
            List<KeyValuePair<string, int>> calls = Util.GetFireAndForgetCallsMade().ToList();
            calls.Sort((kvp1, kvp2) => kvp2.Value.CompareTo(kvp1.Value));
            int namedCallsMade = 0;

            ConsoleDisplayList cdl = new ConsoleDisplayList();
            foreach (KeyValuePair<string, int> kvp in calls)
            {
                cdl.AddRow(kvp.Key, kvp.Value);
                namedCallsMade += kvp.Value;
            }

            cdl.AddRow("TOTAL NAMED", namedCallsMade);

            long allCallsMade = Util.TotalFireAndForgetCallsMade;
            cdl.AddRow("TOTAL ANONYMOUS", allCallsMade - namedCallsMade);
            cdl.AddRow("TOTAL ALL", allCallsMade);

            MainConsole.Instance.Output(cdl.ToString());
        }
Esempio n. 17
0
        private void HandleGetCommand(string module, string[] args)
        {
            if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_udpServer.Scene)
                return;

            m_console.OutputFormat("Debug settings for {0}", m_udpServer.Scene.Name);
            ConsoleDisplayList cdl = new ConsoleDisplayList();

            long maxSceneDripRate = (long)m_udpServer.Throttle.MaxDripRate;
            cdl.AddRow(
                "max-scene-throttle", 
                maxSceneDripRate != 0 ? string.Format("{0} kbps", maxSceneDripRate * 8 / 1000) : "unset");

            int maxClientDripRate = m_udpServer.ThrottleRates.Total;
            cdl.AddRow(
                "max-new-client-throttle", 
                maxClientDripRate != 0 ? string.Format("{0} kbps", maxClientDripRate * 8 / 1000) : "unset");

            m_console.Output(cdl.ToString());
        }
Esempio n. 18
0
        private void HandleShowStatus(string module, string[] cmd)
        {
            ConsoleDisplayList cdl = new ConsoleDisplayList();
            cdl.AddRow("Bot connecting state", BotConnectingState);

            MainConsole.Instance.Output(cdl.ToString());
        }
Esempio n. 19
0
        private void HandleShowRegion(string module, string[] cmd)
        {
            if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene))
                return;

            RegionInfo ri = m_scene.RegionInfo;
            RegionSettings rs = ri.RegionSettings;

            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("Region information for {0}\n", m_scene.Name);

            ConsoleDisplayList dispList = new ConsoleDisplayList();
            dispList.AddRow("Region ID", ri.RegionID);
            dispList.AddRow("Region handle", ri.RegionHandle);
            dispList.AddRow("Region location", string.Format("{0},{1}", ri.RegionLocX, ri.RegionLocY));
            dispList.AddRow("Region size", string.Format("{0}x{1}", ri.RegionSizeX, ri.RegionSizeY));
            //dispList.AddRow("Region type", ri.RegionType);
            dispList.AddRow("Maturity", rs.Maturity);
            dispList.AddRow("Region address", ri.ServerURI);
            dispList.AddRow("From region file", ri.RegionFile);
            dispList.AddRow("External endpoint", ri.ExternalEndPoint);
            dispList.AddRow("Internal endpoint", ri.InternalEndPoint);
            dispList.AddRow("Access level", ri.AccessLevel);
            dispList.AddRow("Agent limit", rs.AgentLimit);
            dispList.AddRow("Max agent limit", ri.AgentCapacity);
            dispList.AddRow("Linkset capacity", ri.LinksetCapacity <= 0 ? "not set" : ri.LinksetCapacity.ToString());
            dispList.AddRow("Prim capacity", ri.ObjectCapacity);
            dispList.AddRow("Prim bonus", rs.ObjectBonus);
            dispList.AddRow("Max prims per user", ri.MaxPrimsPerUser < 0 ? "n/a" : ri.MaxPrimsPerUser.ToString());
            dispList.AddRow("Clamp prim size", ri.ClampPrimSize);
            dispList.AddRow("Non physical prim min size", ri.NonphysPrimMin <= 0 ? "not set" : string.Format("{0} m", ri.NonphysPrimMin));
            dispList.AddRow("Non physical prim max size", ri.NonphysPrimMax <= 0 ? "not set" : string.Format("{0} m", ri.NonphysPrimMax));
            dispList.AddRow("Physical prim min size", ri.PhysPrimMin <= 0 ? "not set" : string.Format("{0} m", ri.PhysPrimMin));
            dispList.AddRow("Physical prim max size", ri.PhysPrimMax <= 0 ? "not set" : string.Format("{0} m", ri.PhysPrimMax));

            dispList.AddRow("Allow Damage", rs.AllowDamage);
            dispList.AddRow("Allow Land join/divide", rs.AllowLandJoinDivide);
            dispList.AddRow("Allow land resell", rs.AllowLandResell);
            dispList.AddRow("Block fly", rs.BlockFly);
            dispList.AddRow("Block show in search", rs.BlockShowInSearch);
            dispList.AddRow("Block terraform", rs.BlockTerraform);
            dispList.AddRow("Covenant UUID", rs.Covenant);
            dispList.AddRow("Convenant change Unix time", rs.CovenantChangedDateTime);
            dispList.AddRow("Disable collisions", rs.DisableCollisions);
            dispList.AddRow("Disable physics", rs.DisablePhysics);
            dispList.AddRow("Disable scripts", rs.DisableScripts);
            dispList.AddRow("Restrict pushing", rs.RestrictPushing);
            dispList.AddRow("Fixed sun", rs.FixedSun);
            dispList.AddRow("Sun position", rs.SunPosition);
            dispList.AddRow("Sun vector", rs.SunVector);
            dispList.AddRow("Use estate sun", rs.UseEstateSun);
            dispList.AddRow("Telehub UUID", rs.TelehubObject);
            dispList.AddRow("Terrain lower limit", string.Format("{0} m", rs.TerrainLowerLimit));
            dispList.AddRow("Terrain raise limit", string.Format("{0} m", rs.TerrainRaiseLimit));
            dispList.AddRow("Water height", string.Format("{0} m", rs.WaterHeight));

            dispList.AddRow("Maptile static file", ri.MaptileStaticFile);
            dispList.AddRow("Maptile static UUID", ri.MaptileStaticUUID);
            dispList.AddRow("Last map refresh", ri.lastMapRefresh);
            dispList.AddRow("Last map UUID", ri.lastMapUUID);

            dispList.AddToStringBuilder(sb);

            MainConsole.Instance.Output(sb.ToString());
        }
Esempio n. 20
0
        private void HandleShowBotStatus(string module, string[] cmd)
        {
            if (cmd.Length != 3)
            {
                MainConsole.Instance.Output("Usage: show bot <n>");
                return;
            }

            int botNumber;

            if (!ConsoleUtil.TryParseConsoleInt(MainConsole.Instance, cmd[2], out botNumber))
                return;

            Bot bot = GetBotFromNumber(botNumber);

            if (bot == null)
            {
                MainConsole.Instance.OutputFormat("Error: No bot found with number {0}", botNumber);
                return;
            }

            ConsoleDisplayList cdl = new ConsoleDisplayList();
            cdl.AddRow("Name", bot.Name);
            cdl.AddRow("Status", bot.ConnectionState);

            Simulator currentSim = bot.Client.Network.CurrentSim;
            cdl.AddRow("Region", currentSim != null ? currentSim.Name : "(none)");

            List<Simulator> connectedSimulators = bot.Simulators;
            List<string> simulatorNames = connectedSimulators.ConvertAll<string>(cs => cs.Name);
            cdl.AddRow("Connections", string.Join(", ", simulatorNames.ToArray()));

            MainConsole.Instance.Output(cdl.ToString());

            MainConsole.Instance.Output("Settings");

            ConsoleDisplayList statusCdl = new ConsoleDisplayList();

            statusCdl.AddRow(
                "Behaviours", 
                string.Join(", ", bot.Behaviours.Values.ToList().ConvertAll<string>(b => b.Name).ToArray()));

            GridClient botClient = bot.Client;
            statusCdl.AddRow("SEND_AGENT_UPDATES", botClient.Settings.SEND_AGENT_UPDATES);

            MainConsole.Instance.Output(statusCdl.ToString());
        }
Esempio n. 21
0
        private void HandleShowScene(string module, string[] cmd)
        {
            if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene))
                return;

            SimStatsReporter r = m_scene.StatsReporter;
            float[] stats = r.LastReportedSimStats;

            float timeDilation            = stats[0];
            float simFps                  = stats[1];
            float physicsFps              = stats[2];
            float agentUpdates            = stats[3];
            float rootAgents              = stats[4];
            float childAgents             = stats[5];
            float totalPrims              = stats[6];
            float activePrims             = stats[7];
            float totalFrameTime          = stats[8];
//            float netFrameTime            = stats.StatsBlock[9].StatValue; // Ignored - not used by OpenSimulator
            float physicsFrameTime        = stats[10];
            float otherFrameTime          = stats[11];
//            float imageFrameTime          = stats.StatsBlock[12].StatValue; // Ignored
            float inPacketsPerSecond      = stats[13];
            float outPacketsPerSecond     = stats[14];
            float unackedBytes            = stats[15];
//            float agentFrameTime          = stats.StatsBlock[16].StatValue; // Not really used
            float pendingDownloads        = stats[17];
            float pendingUploads          = stats[18];
            float activeScripts           = stats[19];
            float scriptLinesPerSecond    = stats[20];

            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("Scene statistics for {0}\n", m_scene.RegionInfo.RegionName);

            ConsoleDisplayList dispList = new ConsoleDisplayList();
            dispList.AddRow("Time Dilation", timeDilation);
            dispList.AddRow("Sim FPS", simFps);
            dispList.AddRow("Physics FPS", physicsFps);
            dispList.AddRow("Avatars", rootAgents);
            dispList.AddRow("Child agents", childAgents);
            dispList.AddRow("Total prims", totalPrims);
            dispList.AddRow("Scripts", activeScripts);
            dispList.AddRow("Script lines processed per second", scriptLinesPerSecond);
            dispList.AddRow("Physics enabled prims", activePrims);
            dispList.AddRow("Total frame time", totalFrameTime);
            dispList.AddRow("Physics frame time", physicsFrameTime);
            dispList.AddRow("Other frame time", otherFrameTime);
            dispList.AddRow("Agent Updates per second", agentUpdates);
            dispList.AddRow("Packets processed from clients per second", inPacketsPerSecond);
            dispList.AddRow("Packets sent to clients per second", outPacketsPerSecond);
            dispList.AddRow("Bytes unacknowledged by clients", unackedBytes);
            dispList.AddRow("Pending asset downloads to clients", pendingDownloads);
            dispList.AddRow("Pending asset uploads from clients", pendingUploads);

            dispList.AddToStringBuilder(sb);

            MainConsole.Instance.Output(sb.ToString());
        }
Esempio n. 22
0
        /// <summary>
        /// Append a scene object part report to an input StringBuilder
        /// </summary>
        /// <returns></returns>
        /// <param name='sb'></param>
        /// <param name='sop'</param>
        /// <param name='showFull'>
        /// If true then information on each inventory item will be shown.
        /// If false then only summary inventory information is shown.
        /// </param>
        private StringBuilder AddScenePartReport(StringBuilder sb, SceneObjectPart sop, bool showFull)
        {
            ConsoleDisplayList cdl = new ConsoleDisplayList();
            cdl.AddRow("Name", sop.Name);
            cdl.AddRow("Description", sop.Description);
            cdl.AddRow("Local ID", sop.LocalId);
            cdl.AddRow("UUID", sop.UUID);
            cdl.AddRow("Location",  string.Format("{0} @ {1}", sop.AbsolutePosition, sop.ParentGroup.Scene.Name));
            cdl.AddRow(
                "Parent",
                sop.IsRoot ? "Is Root" : string.Format("{0} {1}", sop.ParentGroup.Name, sop.ParentGroup.UUID));
            cdl.AddRow("Link number", sop.LinkNum);
            cdl.AddRow("Flags", sop.Flags);

            if (showFull)
            {
                PrimitiveBaseShape s = sop.Shape;
                cdl.AddRow("FlexiDrag", s.FlexiDrag);
                cdl.AddRow("FlexiEntry", s.FlexiEntry);
                cdl.AddRow("FlexiForce", string.Format("<{0},{1},{2}>", s.FlexiForceX, s.FlexiForceY, s.FlexiForceZ));
                cdl.AddRow("FlexiGravity", s.FlexiGravity);
                cdl.AddRow("FlexiSoftness", s.FlexiSoftness);
                cdl.AddRow("HollowShape", s.HollowShape);
                cdl.AddRow(
                    "LightColor", 
                    string.Format("<{0},{1},{2},{3}>", s.LightColorR, s.LightColorB, s.LightColorG, s.LightColorA));
                cdl.AddRow("LightCutoff", s.LightCutoff);
                cdl.AddRow("LightEntry", s.LightEntry);
                cdl.AddRow("LightFalloff", s.LightFalloff);
                cdl.AddRow("LightIntensity", s.LightIntensity);
                cdl.AddRow("LightRadius", s.LightRadius);
                cdl.AddRow("Location (relative)", sop.RelativePosition);
                cdl.AddRow("Media", string.Format("{0} entries", s.Media != null ? s.Media.Count.ToString() : "n/a"));
                cdl.AddRow("PathBegin", s.PathBegin);
                cdl.AddRow("PathEnd", s.PathEnd);
                cdl.AddRow("PathCurve", s.PathCurve);
                cdl.AddRow("PathRadiusOffset", s.PathRadiusOffset);
                cdl.AddRow("PathRevolutions", s.PathRevolutions);
                cdl.AddRow("PathScale", string.Format("<{0},{1}>", s.PathScaleX, s.PathScaleY));
                cdl.AddRow("PathSkew", string.Format("<{0},{1}>", s.PathShearX, s.PathShearY));
                cdl.AddRow("FlexiDrag", s.PathSkew);
                cdl.AddRow("PathTaper", string.Format("<{0},{1}>", s.PathTaperX, s.PathTaperY));
                cdl.AddRow("PathTwist", s.PathTwist);
                cdl.AddRow("PathTwistBegin", s.PathTwistBegin);
                cdl.AddRow("PCode", s.PCode);
                cdl.AddRow("ProfileBegin", s.ProfileBegin);
                cdl.AddRow("ProfileEnd", s.ProfileEnd);
                cdl.AddRow("ProfileHollow", s.ProfileHollow);
                cdl.AddRow("ProfileShape", s.ProfileShape);
                cdl.AddRow("ProjectionAmbiance", s.ProjectionAmbiance);
                cdl.AddRow("ProjectionEntry", s.ProjectionEntry);
                cdl.AddRow("ProjectionFocus", s.ProjectionFocus);
                cdl.AddRow("ProjectionFOV", s.ProjectionFOV);
                cdl.AddRow("ProjectionTextureUUID", s.ProjectionTextureUUID);
                cdl.AddRow("Rotation (Relative)", sop.RotationOffset);
                cdl.AddRow("Rotation (World)", sop.GetWorldRotation());
                cdl.AddRow("Scale", s.Scale);
                cdl.AddRow(
                    "SculptData", 
                    string.Format("{0} bytes", s.SculptData != null ? s.SculptData.Length.ToString() : "n/a"));
                cdl.AddRow("SculptEntry", s.SculptEntry);
                cdl.AddRow("SculptTexture", s.SculptTexture);
                cdl.AddRow("SculptType", s.SculptType);
                cdl.AddRow("State", s.State);

                // TODO, unpack and display texture entries
                //cdl.AddRow("Textures", string.Format("{0} entries", s.Textures.
            }

            object itemsOutput;
            if (showFull)
            {
                StringBuilder itemsSb = new StringBuilder("\n");
                itemsOutput = AddScenePartItemsReport(itemsSb, sop.Inventory).ToString();
            }
            else
            {
                itemsOutput = sop.Inventory.Count;
            }

            cdl.AddRow("Items", itemsOutput);

            return sb.Append(cdl.ToString());
        }
        private void HandleShowBotStatus(string module, string[] cmd)
        {
            if (cmd.Length != 3)
            {
                MainConsole.Instance.Output("Usage: show bot <n>");
                return;
            }

            int botNumber;

            if (!ConsoleUtil.TryParseConsoleInt(MainConsole.Instance, cmd[2], out botNumber))
                return;

            string name = string.Format("{0} {1}_{2}", m_firstName, m_lastNameStem, botNumber);

            Bot bot;

            lock (m_bots)
                bot = m_bots.Find(b => b.Name == name);

            if (bot == null)
            {
                MainConsole.Instance.Output("No bot found with name {0}", name);
                return;
            }

            ConsoleDisplayList cdl = new ConsoleDisplayList();
            cdl.AddRow("Name", bot.Name);
            cdl.AddRow("Status", bot.ConnectionState);

            Simulator currentSim = bot.Client.Network.CurrentSim;
            cdl.AddRow("Region", currentSim != null ? currentSim.Name : "(none)");

            List<Simulator> connectedSimulators = bot.Simulators;
            List<string> simulatorNames = connectedSimulators.ConvertAll<string>(cs => cs.Name);
            cdl.AddRow("Connections", string.Join(", ", simulatorNames.ToArray()));

            MainConsole.Instance.Output(cdl.ToString());

            MainConsole.Instance.Output("Settings");

            ConsoleDisplayList statusCdl = new ConsoleDisplayList();
            GridClient botClient = bot.Client;
            statusCdl.AddRow("SEND_AGENT_UPDATES", botClient.Settings.SEND_AGENT_UPDATES);

            MainConsole.Instance.Output(statusCdl.ToString());
        }