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 HandleShowStatus(string module, string[] cmd) { ConsoleDisplayList cdl = new ConsoleDisplayList(); cdl.AddRow("Bot connecting state", BotConnectingState); MainConsole.Instance.Output(cdl.ToString()); }
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()); }
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()); }
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()); }
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()); }
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; }
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()); }
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()); }
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()); }
/// <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()); }
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()); } }); }
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()); }
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()); } }); }
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()); }
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()); }
/// <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()); }