aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs')
-rw-r--r--OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs75
1 files changed, 60 insertions, 15 deletions
diff --git a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
index db70e56..95aa864 100644
--- a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
@@ -79,7 +79,19 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
79// m_log.DebugFormat("[LINDEN UDP INFO MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName); 79// m_log.DebugFormat("[LINDEN UDP INFO MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName);
80 80
81 lock (m_scenes) 81 lock (m_scenes)
82 m_scenes[scene.RegionInfo.RegionID] = scene; 82 m_scenes[scene.RegionInfo.RegionID] = scene;
83
84 scene.AddCommand(
85 this, "image queues clear",
86 "image queues clear <first-name> <last-name>",
87 "Clear the image queues (textures downloaded via UDP) for a particular client.",
88 (mod, cmd) => MainConsole.Instance.Output(HandleImageQueuesClear(cmd)));
89
90 scene.AddCommand(
91 this, "show image queues",
92 "image queues show <first-name> <last-name>",
93 "Show the image queues (textures downloaded via UDP) for a particular client.",
94 (mod, cmd) => MainConsole.Instance.Output(GetImageQueuesReport(cmd)));
83 95
84 scene.AddCommand( 96 scene.AddCommand(
85 this, "show pqueues", 97 this, "show pqueues",
@@ -116,7 +128,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
116 "emergency-monitoring", 128 "emergency-monitoring",
117 "Go on/off emergency monitoring mode", 129 "Go on/off emergency monitoring mode",
118 "Go on/off emergency monitoring mode", 130 "Go on/off emergency monitoring mode",
119 EmergencyMonitoring); 131 HandleEmergencyMonitoring);
120 } 132 }
121 133
122 public void RemoveRegion(Scene scene) 134 public void RemoveRegion(Scene scene)
@@ -132,7 +144,49 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
132// m_log.DebugFormat("[LINDEN UDP INFO MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName); 144// m_log.DebugFormat("[LINDEN UDP INFO MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName);
133 } 145 }
134 146
135 protected void EmergencyMonitoring(string module, string[] cmd) 147 protected string HandleImageQueuesClear(string[] cmd)
148 {
149 if (cmd.Length != 5)
150 return "Usage: image queues clear <first-name> <last-name>";
151
152 string firstName = cmd[3];
153 string lastName = cmd[4];
154
155 List<ScenePresence> foundAgents = new List<ScenePresence>();
156
157 lock (m_scenes)
158 {
159 foreach (Scene scene in m_scenes.Values)
160 {
161 ScenePresence sp = scene.GetScenePresence(firstName, lastName);
162 if (sp != null)
163 foundAgents.Add(sp);
164 }
165 }
166
167 if (foundAgents.Count == 0)
168 return string.Format("No agents found for {0} {1}", firstName, lastName);
169
170 StringBuilder report = new StringBuilder();
171
172 foreach (ScenePresence agent in foundAgents)
173 {
174 LLClientView client = agent.ControllingClient as LLClientView;
175
176 if (client == null)
177 return "This command is only supported for LLClientView";
178
179 int requestsDeleted = client.ImageManager.ClearImageQueue();
180
181 report.AppendFormat(
182 "In region {0} ({1} agent) cleared {2} requests\n",
183 agent.Scene.RegionInfo.RegionName, agent.IsChildAgent ? "child" : "root", requestsDeleted);
184 }
185
186 return report.ToString();
187 }
188
189 protected void HandleEmergencyMonitoring(string module, string[] cmd)
136 { 190 {
137 bool mode = true; 191 bool mode = true;
138 if (cmd.Length == 1 || (cmd.Length > 1 && cmd[1] == "on")) 192 if (cmd.Length == 1 || (cmd.Length > 1 && cmd[1] == "on"))
@@ -239,10 +293,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
239 private string GetImageQueuesReport(string[] showParams) 293 private string GetImageQueuesReport(string[] showParams)
240 { 294 {
241 if (showParams.Length < 5 || showParams.Length > 6) 295 if (showParams.Length < 5 || showParams.Length > 6)
242 { 296 return "Usage: show image queues <first-name> <last-name> [full]";
243 MainConsole.Instance.OutputFormat("Usage: show image queues <first-name> <last-name> [full]");
244 return "";
245 }
246 297
247 string firstName = showParams[3]; 298 string firstName = showParams[3];
248 string lastName = showParams[4]; 299 string lastName = showParams[4];
@@ -262,10 +313,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
262 } 313 }
263 314
264 if (foundAgents.Count == 0) 315 if (foundAgents.Count == 0)
265 { 316 return string.Format("No agents found for {0} {1}", firstName, lastName);
266 MainConsole.Instance.OutputFormat("No agents found for {0} {1}", firstName, lastName);
267 return "";
268 }
269 317
270 StringBuilder report = new StringBuilder(); 318 StringBuilder report = new StringBuilder();
271 319
@@ -274,10 +322,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
274 LLClientView client = agent.ControllingClient as LLClientView; 322 LLClientView client = agent.ControllingClient as LLClientView;
275 323
276 if (client == null) 324 if (client == null)
277 { 325 return "This command is only supported for LLClientView";
278 MainConsole.Instance.OutputFormat("This command is only supported for LLClientView");
279 return "";
280 }
281 326
282 J2KImage[] images = client.ImageManager.GetImages(); 327 J2KImage[] images = client.ImageManager.GetImages();
283 328