aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2012-01-10 21:28:59 +0000
committerMelanie2012-01-10 21:28:59 +0000
commit8fa1108b72f053b17964d668458ab8b6c1d44f4f (patch)
tree670fe65a58d9edddb847775583ac1fd69d8dc7c0
parentMerge branch 'master' into careminster (diff)
parentrename "show image queue" to "show image queues" in line with other udp info ... (diff)
downloadopensim-SC_OLD-8fa1108b72f053b17964d668458ab8b6c1d44f4f.zip
opensim-SC_OLD-8fa1108b72f053b17964d668458ab8b6c1d44f4f.tar.gz
opensim-SC_OLD-8fa1108b72f053b17964d668458ab8b6c1d44f4f.tar.bz2
opensim-SC_OLD-8fa1108b72f053b17964d668458ab8b6c1d44f4f.tar.xz
Merge branch 'master' into careminster
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs14
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs10
-rw-r--r--OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs104
3 files changed, 104 insertions, 24 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 4d3a30c..a097ec9 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -306,6 +306,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
306 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 306 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
307 protected static Dictionary<PacketType, PacketMethod> PacketHandlers = new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients 307 protected static Dictionary<PacketType, PacketMethod> PacketHandlers = new Dictionary<PacketType, PacketMethod>(); //Global/static handlers for all clients
308 308
309 /// <summary>
310 /// Handles UDP texture download.
311 /// </summary>
312 public LLImageManager ImageManager { get; private set; }
313
309 private readonly LLUDPServer m_udpServer; 314 private readonly LLUDPServer m_udpServer;
310 private readonly LLUDPClient m_udpClient; 315 private readonly LLUDPClient m_udpClient;
311 private readonly UUID m_sessionId; 316 private readonly UUID m_sessionId;
@@ -351,7 +356,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
351 protected Dictionary<PacketType, PacketProcessor> m_packetHandlers = new Dictionary<PacketType, PacketProcessor>(); 356 protected Dictionary<PacketType, PacketProcessor> m_packetHandlers = new Dictionary<PacketType, PacketProcessor>();
352 protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers 357 protected Dictionary<string, GenericMessage> m_genericPacketHandlers = new Dictionary<string, GenericMessage>(); //PauPaw:Local Generic Message handlers
353 protected Scene m_scene; 358 protected Scene m_scene;
354 private LLImageManager m_imageManager;
355 protected string m_firstName; 359 protected string m_firstName;
356 protected string m_lastName; 360 protected string m_lastName;
357 protected Thread m_clientThread; 361 protected Thread m_clientThread;
@@ -470,7 +474,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
470 474
471 m_assetService = m_scene.RequestModuleInterface<IAssetService>(); 475 m_assetService = m_scene.RequestModuleInterface<IAssetService>();
472 m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>(); 476 m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>();
473 m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>()); 477 ImageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>());
474 m_channelVersion = Util.StringToBytes256(scene.GetSimulatorVersion()); 478 m_channelVersion = Util.StringToBytes256(scene.GetSimulatorVersion());
475 m_agentId = agentId; 479 m_agentId = agentId;
476 m_sessionId = sessionId; 480 m_sessionId = sessionId;
@@ -522,7 +526,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
522 IsActive = false; 526 IsActive = false;
523 527
524 // Shutdown the image manager 528 // Shutdown the image manager
525 m_imageManager.Close(); 529 ImageManager.Close();
526 530
527 // Fire the callback for this connection closing 531 // Fire the callback for this connection closing
528 if (OnConnectionClosed != null) 532 if (OnConnectionClosed != null)
@@ -3983,7 +3987,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3983 } 3987 }
3984 3988
3985 if ((categories & ThrottleOutPacketTypeFlags.Texture) != 0) 3989 if ((categories & ThrottleOutPacketTypeFlags.Texture) != 0)
3986 m_imageManager.ProcessImageQueue(m_udpServer.TextureSendLimit); 3990 ImageManager.ProcessImageQueue(m_udpServer.TextureSendLimit);
3987 } 3991 }
3988 3992
3989 public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID) 3993 public void SendAssetUploadCompleteMessage(sbyte AssetType, bool Success, UUID AssetFullID)
@@ -7531,7 +7535,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7531 if ((ImageType)block.Type == ImageType.Baked) 7535 if ((ImageType)block.Type == ImageType.Baked)
7532 args.Priority *= 2.0f; 7536 args.Priority *= 2.0f;
7533 7537
7534 m_imageManager.EnqueueReq(args); 7538 ImageManager.EnqueueReq(args);
7535 } 7539 }
7536 7540
7537 return true; 7541 return true;
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs
index 3e31b7d..db428f1 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLImageManager.cs
@@ -245,6 +245,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
245 m_shuttingdown = true; 245 m_shuttingdown = true;
246 } 246 }
247 247
248 /// <summary>
249 /// Returns an array containing all the images in the queue.
250 /// </summary>
251 /// <returns></returns>
252 public J2KImage[] GetImages()
253 {
254 lock (m_priorityQueue)
255 return m_priorityQueue.ToArray();
256 }
257
248 #region Priority Queue Helpers 258 #region Priority Queue Helpers
249 259
250 private J2KImage GetHighestPriorityImage() 260 private J2KImage GetHighestPriorityImage()
diff --git a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
index c754019..58b9b9f 100644
--- a/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
+++ b/OpenSim/Region/OptionalModules/Agent/UDP/Linden/LindenUDPInfoModule.cs
@@ -87,7 +87,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
87 "Show priority queue data for each client", 87 "Show priority queue data for each client",
88 "Without the 'full' option, only root agents are shown." 88 "Without the 'full' option, only root agents are shown."
89 + " With the 'full' option child agents are also shown.", 89 + " With the 'full' option child agents are also shown.",
90 ShowPQueuesReport); 90 (mod, cmd) => MainConsole.Instance.Output(GetPQueuesReport(cmd)));
91 91
92 scene.AddCommand( 92 scene.AddCommand(
93 this, "show queues", 93 this, "show queues",
@@ -95,7 +95,13 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
95 "Show queue data for each client", 95 "Show queue data for each client",
96 "Without the 'full' option, only root agents are shown." 96 "Without the 'full' option, only root agents are shown."
97 + " With the 'full' option child agents are also shown.", 97 + " With the 'full' option child agents are also shown.",
98 ShowQueuesReport); 98 (mod, cmd) => MainConsole.Instance.Output(GetQueuesReport(cmd)));
99
100 scene.AddCommand(
101 this, "show image queues",
102 "show image queues <first-name> <last-name>",
103 "Show the image queues (textures downloaded via UDP) for a particular client.",
104 (mod, cmd) => MainConsole.Instance.Output(GetImageQueuesReport(cmd)));
99 105
100 scene.AddCommand( 106 scene.AddCommand(
101 this, "show throttles", 107 this, "show throttles",
@@ -103,7 +109,7 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
103 "Show throttle settings for each client and for the server overall", 109 "Show throttle settings for each client and for the server overall",
104 "Without the 'full' option, only root agents are shown." 110 "Without the 'full' option, only root agents are shown."
105 + " With the 'full' option child agents are also shown.", 111 + " With the 'full' option child agents are also shown.",
106 ShowThrottlesReport); 112 (mod, cmd) => MainConsole.Instance.Output(GetThrottlesReport(cmd)));
107 113
108 scene.AddCommand( 114 scene.AddCommand(
109 this, "emergency-monitoring", 115 this, "emergency-monitoring",
@@ -124,21 +130,6 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
124 public void RegionLoaded(Scene scene) 130 public void RegionLoaded(Scene scene)
125 { 131 {
126// m_log.DebugFormat("[LINDEN UDP INFO MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName); 132// m_log.DebugFormat("[LINDEN UDP INFO MODULE]: REGION {0} LOADED", scene.RegionInfo.RegionName);
127 }
128
129 protected void ShowPQueuesReport(string module, string[] cmd)
130 {
131 MainConsole.Instance.Output(GetPQueuesReport(cmd));
132 }
133
134 protected void ShowQueuesReport(string module, string[] cmd)
135 {
136 MainConsole.Instance.Output(GetQueuesReport(cmd));
137 }
138
139 protected void ShowThrottlesReport(string module, string[] cmd)
140 {
141 MainConsole.Instance.Output(GetThrottlesReport(cmd));
142 } 133 }
143 134
144 protected void EmergencyMonitoring(string module, string[] cmd) 135 protected void EmergencyMonitoring(string module, string[] cmd)
@@ -166,7 +157,6 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
166 entry.Length > maxLength ? entry.Substring(0, maxLength) : entry, 157 entry.Length > maxLength ? entry.Substring(0, maxLength) : entry,
167 ""); 158 "");
168 } 159 }
169
170 160
171 /// <summary> 161 /// <summary>
172 /// Generate UDP Queue data report for each client 162 /// Generate UDP Queue data report for each client
@@ -240,6 +230,82 @@ namespace OpenSim.Region.CoreModules.UDP.Linden
240 230
241 return report.ToString(); 231 return report.ToString();
242 } 232 }
233
234 /// <summary>
235 /// Generate an image queue report
236 /// </summary>
237 /// <param name="showParams"></param>
238 /// <returns></returns>
239 private string GetImageQueuesReport(string[] showParams)
240 {
241 if (showParams.Length < 5 || showParams.Length > 6)
242 {
243 MainConsole.Instance.OutputFormat("Usage: show image queues <first-name> <last-name> [full]");
244 return "";
245 }
246
247 string firstName = showParams[3];
248 string lastName = showParams[4];
249
250 bool showChildAgents = showParams.Length == 6;
251
252 List<ScenePresence> foundAgents = new List<ScenePresence>();
253
254 lock (m_scenes)
255 {
256 foreach (Scene scene in m_scenes.Values)
257 {
258 ScenePresence sp = scene.GetScenePresence(firstName, lastName);
259 if (sp != null && (showChildAgents || !sp.IsChildAgent))
260 foundAgents.Add(sp);
261 }
262 }
263
264 if (foundAgents.Count == 0)
265 {
266 MainConsole.Instance.OutputFormat("No agents found for {0} {1}", firstName, lastName);
267 return "";
268 }
269
270 StringBuilder report = new StringBuilder();
271
272 foreach (ScenePresence agent in foundAgents)
273 {
274 LLClientView client = agent.ControllingClient as LLClientView;
275
276 if (client == null)
277 {
278 MainConsole.Instance.OutputFormat("This command is only supported for LLClientView");
279 return "";
280 }
281
282 J2KImage[] images = client.ImageManager.GetImages();
283
284 report.AppendFormat(
285 "In region {0} ({1} agent)\n",
286 agent.Scene.RegionInfo.RegionName, agent.IsChildAgent ? "child" : "root");
287 report.AppendFormat("Images in queue: {0}\n", images.Length);
288
289 if (images.Length > 0)
290 {
291 report.AppendFormat(
292 "{0,-36} {1,-8} {2,-9} {3,-9} {4,-9} {5,-7}\n",
293 "Texture ID",
294 "Last Seq",
295 "Priority",
296 "Start Pkt",
297 "Has Asset",
298 "Decoded");
299
300 foreach (J2KImage image in images)
301 report.AppendFormat(
302 "{0,36} {1,8} {2,9} {3,10} {4,9} {5,7}\n",
303 image.TextureID, image.LastSequence, image.Priority, image.StartPacket, image.HasAsset, image.IsDecoded);
304 }
305 }
306
307 return report.ToString();
308 }
243 309
244 /// <summary> 310 /// <summary>
245 /// Generate UDP Queue data report for each client 311 /// Generate UDP Queue data report for each client