aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorDan Lake2012-10-08 15:25:26 -0700
committerDan Lake2012-10-08 15:25:26 -0700
commitd342adaa8760ee7ada1b87dec1c8c415c9e77f73 (patch)
treea914c203322b761640450c7be06c54984b64494d /OpenSim/Region
parentAdd bool to TriggerSceneObjectPartUpdated where full = true indicates a full ... (diff)
parentFix build break (diff)
downloadopensim-SC-d342adaa8760ee7ada1b87dec1c8c415c9e77f73.zip
opensim-SC-d342adaa8760ee7ada1b87dec1c8c415c9e77f73.tar.gz
opensim-SC-d342adaa8760ee7ada1b87dec1c8c415c9e77f73.tar.bz2
opensim-SC-d342adaa8760ee7ada1b87dec1c8c415c9e77f73.tar.xz
Merge branch 'master' of git://opensimulator.org/git/opensim
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs3
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs42
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs22
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs2
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs19
-rw-r--r--OpenSim/Region/UserStatistics/WebStatsModule.cs56
10 files changed, 111 insertions, 41 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index d05ffea..0869bd5 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -5862,7 +5862,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5862 msgpack.MessageBlock.ID, 5862 msgpack.MessageBlock.ID,
5863 msgpack.MessageBlock.Offline != 0 ? true : false, 5863 msgpack.MessageBlock.Offline != 0 ? true : false,
5864 msgpack.MessageBlock.Position, 5864 msgpack.MessageBlock.Position,
5865 msgpack.MessageBlock.BinaryBucket); 5865 msgpack.MessageBlock.BinaryBucket,
5866 true);
5866 5867
5867 handlerInstantMessage(this, im); 5868 handlerInstantMessage(this, im);
5868 } 5869 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs
index d942e87..5ec0ea9 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/CallingCardModule.cs
@@ -141,7 +141,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
141 client.FirstName+" "+client.LastName, 141 client.FirstName+" "+client.LastName,
142 destID, (byte)211, false, 142 destID, (byte)211, false,
143 String.Empty, 143 String.Empty,
144 transactionID, false, new Vector3(), new byte[0]), 144 transactionID, false, new Vector3(), new byte[0], true),
145 delegate(bool success) {} ); 145 delegate(bool success) {} );
146 } 146 }
147 } 147 }
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
index 91eda19..33b4839 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Transfer/InventoryTransferModule.cs
@@ -297,6 +297,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
297 }); 297 });
298 } 298 }
299 } 299 }
300
301 // XXX: This code was placed here to try and accomdate RLV which moves given folders named #RLV/~<name>
302 // to a folder called name in #RLV. However, this approach may not be ultimately correct - from analysis
303 // of Firestorm 4.2.2 on sending an InventoryOffered instead of TaskInventoryOffered (as was previously
304 // done), the viewer itself would appear to move and rename the folder, rather than the simulator doing it here.
300 else if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted) 305 else if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted)
301 { 306 {
302 UUID destinationFolderID = UUID.Zero; 307 UUID destinationFolderID = UUID.Zero;
@@ -308,6 +313,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
308 313
309 if (destinationFolderID != UUID.Zero) 314 if (destinationFolderID != UUID.Zero)
310 { 315 {
316 InventoryFolderBase destinationFolder = new InventoryFolderBase(destinationFolderID, client.AgentId);
317 if (destinationFolder == null)
318 {
319 m_log.WarnFormat(
320 "[INVENTORY TRANSFER]: TaskInventoryAccepted message from {0} in {1} specified folder {2} which does not exist",
321 client.Name, scene.Name, destinationFolderID);
322
323 return;
324 }
325
311 IInventoryService invService = scene.InventoryService; 326 IInventoryService invService = scene.InventoryService;
312 327
313 UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip 328 UUID inventoryID = new UUID(im.imSessionID); // The inventory item/folder, back from it's trip
@@ -315,9 +330,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
315 InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId); 330 InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId);
316 item = invService.GetItem(item); 331 item = invService.GetItem(item);
317 InventoryFolderBase folder = null; 332 InventoryFolderBase folder = null;
333 UUID? previousParentFolderID = null;
318 334
319 if (item != null) // It's an item 335 if (item != null) // It's an item
320 { 336 {
337 previousParentFolderID = item.Folder;
321 item.Folder = destinationFolderID; 338 item.Folder = destinationFolderID;
322 339
323 invService.DeleteItems(item.Owner, new List<UUID>() { item.ID }); 340 invService.DeleteItems(item.Owner, new List<UUID>() { item.ID });
@@ -330,10 +347,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
330 347
331 if (folder != null) // It's a folder 348 if (folder != null) // It's a folder
332 { 349 {
350 previousParentFolderID = folder.ParentID;
333 folder.ParentID = destinationFolderID; 351 folder.ParentID = destinationFolderID;
334 invService.MoveFolder(folder); 352 invService.MoveFolder(folder);
335 } 353 }
336 } 354 }
355
356 // Tell client about updates to original parent and new parent (this should probably be factored with existing move item/folder code).
357 if (previousParentFolderID != null)
358 {
359 InventoryFolderBase previousParentFolder
360 = new InventoryFolderBase((UUID)previousParentFolderID, client.AgentId);
361 previousParentFolder = invService.GetFolder(previousParentFolder);
362 scene.SendInventoryUpdate(client, previousParentFolder, true, true);
363
364 scene.SendInventoryUpdate(client, destinationFolder, true, true);
365 }
337 } 366 }
338 } 367 }
339 else if ( 368 else if (
@@ -354,9 +383,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
354 InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId); 383 InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId);
355 item = invService.GetItem(item); 384 item = invService.GetItem(item);
356 InventoryFolderBase folder = null; 385 InventoryFolderBase folder = null;
386 UUID? previousParentFolderID = null;
357 387
358 if (item != null && trashFolder != null) 388 if (item != null && trashFolder != null)
359 { 389 {
390 previousParentFolderID = item.Folder;
360 item.Folder = trashFolder.ID; 391 item.Folder = trashFolder.ID;
361 392
362 // Diva comment: can't we just update this item??? 393 // Diva comment: can't we just update this item???
@@ -372,6 +403,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
372 403
373 if (folder != null & trashFolder != null) 404 if (folder != null & trashFolder != null)
374 { 405 {
406 previousParentFolderID = folder.ParentID;
375 folder.ParentID = trashFolder.ID; 407 folder.ParentID = trashFolder.ID;
376 invService.MoveFolder(folder); 408 invService.MoveFolder(folder);
377 } 409 }
@@ -391,6 +423,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
391 client.SendAgentAlertMessage("Unable to delete "+ 423 client.SendAgentAlertMessage("Unable to delete "+
392 "received inventory" + reason, false); 424 "received inventory" + reason, false);
393 } 425 }
426 // Tell client about updates to original parent and new parent (this should probably be factored with existing move item/folder code).
427 else if (previousParentFolderID != null)
428 {
429 InventoryFolderBase previousParentFolder
430 = new InventoryFolderBase((UUID)previousParentFolderID, client.AgentId);
431 previousParentFolder = invService.GetFolder(previousParentFolder);
432 scene.SendInventoryUpdate(client, previousParentFolder, true, true);
433
434 scene.SendInventoryUpdate(client, trashFolder, true, true);
435 }
394 436
395 ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID)); 437 ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID));
396 438
diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
index 92cf9d1..9c369f6 100644
--- a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
@@ -186,7 +186,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
186 client.FirstName+" "+client.LastName, targetid, 186 client.FirstName+" "+client.LastName, targetid,
187 (byte)InstantMessageDialog.RequestTeleport, false, 187 (byte)InstantMessageDialog.RequestTeleport, false,
188 message, sessionID, false, presence.AbsolutePosition, 188 message, sessionID, false, presence.AbsolutePosition,
189 new Byte[0]); 189 new Byte[0], true);
190 m.RegionID = client.Scene.RegionInfo.RegionID.Guid; 190 m.RegionID = client.Scene.RegionInfo.RegionID.Guid;
191 191
192 m_log.DebugFormat("[HG LURE MODULE]: RequestTeleport sessionID={0}, regionID={1}, message={2}", m.imSessionID, m.RegionID, m.message); 192 m_log.DebugFormat("[HG LURE MODULE]: RequestTeleport sessionID={0}, regionID={1}, message={2}", m.imSessionID, m.RegionID, m.message);
diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs
index 2d4cffd..6ce9556 100644
--- a/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Lure/LureModule.cs
@@ -169,7 +169,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
169 client.FirstName+" "+client.LastName, targetid, 169 client.FirstName+" "+client.LastName, targetid,
170 (byte)InstantMessageDialog.RequestTeleport, false, 170 (byte)InstantMessageDialog.RequestTeleport, false,
171 message, dest, false, presence.AbsolutePosition, 171 message, dest, false, presence.AbsolutePosition,
172 new Byte[0]); 172 new Byte[0], true);
173 173
174 if (m_TransferModule != null) 174 if (m_TransferModule != null)
175 { 175 {
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index b51570f..617a350 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1068,6 +1068,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1068 Scene initiatingScene) 1068 Scene initiatingScene)
1069 { 1069 {
1070 Thread.Sleep(10000); 1070 Thread.Sleep(10000);
1071
1071 IMessageTransferModule im = initiatingScene.RequestModuleInterface<IMessageTransferModule>(); 1072 IMessageTransferModule im = initiatingScene.RequestModuleInterface<IMessageTransferModule>();
1072 if (im != null) 1073 if (im != null)
1073 { 1074 {
@@ -1080,11 +1081,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1080 (uint)(int)position.X, 1081 (uint)(int)position.X,
1081 (uint)(int)position.Y, 1082 (uint)(int)position.Y,
1082 (uint)(int)position.Z); 1083 (uint)(int)position.Z);
1083 GridInstantMessage m = new GridInstantMessage(initiatingScene, UUID.Zero, 1084
1084 "Region", agent.UUID, 1085 GridInstantMessage m
1085 (byte)InstantMessageDialog.GodLikeRequestTeleport, false, 1086 = new GridInstantMessage(
1086 "", gotoLocation, false, new Vector3(127, 0, 0), 1087 initiatingScene,
1087 new Byte[0]); 1088 UUID.Zero,
1089 "Region",
1090 agent.UUID,
1091 (byte)InstantMessageDialog.GodLikeRequestTeleport,
1092 false,
1093 "",
1094 gotoLocation,
1095 false,
1096 new Vector3(127, 0, 0),
1097 new Byte[0],
1098 false);
1099
1088 im.SendInstantMessage(m, delegate(bool success) 1100 im.SendInstantMessage(m, delegate(bool success)
1089 { 1101 {
1090 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Client Initiating Teleport sending IM success = {0}", success); 1102 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Client Initiating Teleport sending IM success = {0}", success);
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 3b59dc4..b23ddb4 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -1424,7 +1424,7 @@ namespace OpenSim.Region.Framework.Scenes
1424 return newFolderID; 1424 return newFolderID;
1425 } 1425 }
1426 1426
1427 private void SendInventoryUpdate(IClientAPI client, InventoryFolderBase folder, bool fetchFolders, bool fetchItems) 1427 public void SendInventoryUpdate(IClientAPI client, InventoryFolderBase folder, bool fetchFolders, bool fetchItems)
1428 { 1428 {
1429 if (folder == null) 1429 if (folder == null)
1430 return; 1430 return;
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index a8e4d90..ffd4222 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -148,7 +148,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
148 OnInstantMessage(this, new GridInstantMessage(m_scene, 148 OnInstantMessage(this, new GridInstantMessage(m_scene,
149 m_uuid, m_firstname + " " + m_lastname, 149 m_uuid, m_firstname + " " + m_lastname,
150 target, 0, false, message, 150 target, 0, false, message,
151 UUID.Zero, false, Position, new byte[0])); 151 UUID.Zero, false, Position, new byte[0], true));
152 } 152 }
153 153
154 public void SendAgentOffline(UUID[] agentIDs) 154 public void SendAgentOffline(UUID[] agentIDs)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 7fa6f05..7620df3 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -3978,7 +3978,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
3978 World.RegionInfo.RegionName+" "+ 3978 World.RegionInfo.RegionName+" "+
3979 m_host.AbsolutePosition.ToString(), 3979 m_host.AbsolutePosition.ToString(),
3980 agentItem.ID, true, m_host.AbsolutePosition, 3980 agentItem.ID, true, m_host.AbsolutePosition,
3981 bucket); 3981 bucket, true); // TODO: May actually send no timestamp
3982 3982
3983 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); 3983 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {});
3984 } 3984 }
@@ -6452,16 +6452,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
6452 if (m_TransferModule != null) 6452 if (m_TransferModule != null)
6453 { 6453 {
6454 byte[] bucket = new byte[] { (byte)AssetType.Folder }; 6454 byte[] bucket = new byte[] { (byte)AssetType.Folder };
6455 6455
6456 Vector3 pos = m_host.AbsolutePosition;
6457
6456 GridInstantMessage msg = new GridInstantMessage(World, 6458 GridInstantMessage msg = new GridInstantMessage(World,
6457 m_host.UUID, m_host.Name + ", an object owned by " + 6459 m_host.OwnerID, m_host.Name, destID,
6458 resolveName(m_host.OwnerID) + ",", destID,
6459 (byte)InstantMessageDialog.TaskInventoryOffered, 6460 (byte)InstantMessageDialog.TaskInventoryOffered,
6460 false, category + "\n" + m_host.Name + " is located at " + 6461 false, string.Format("'{0}'"),
6461 World.RegionInfo.RegionName + " " + 6462// We won't go so far as to add a SLURL, but this is the format used by LL as of 2012-10-06
6462 m_host.AbsolutePosition.ToString(), 6463// false, string.Format("'{0}' ( http://slurl.com/secondlife/{1}/{2}/{3}/{4} )", category, World.Name, (int)pos.X, (int)pos.Y, (int)pos.Z),
6463 folderID, true, m_host.AbsolutePosition, 6464 folderID, false, pos,
6464 bucket); 6465 bucket, false);
6465 6466
6466 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {}); 6467 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {});
6467 } 6468 }
diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs
index c11ea02..625eba4 100644
--- a/OpenSim/Region/UserStatistics/WebStatsModule.cs
+++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs
@@ -61,7 +61,7 @@ namespace OpenSim.Region.UserStatistics
61 /// <summary> 61 /// <summary>
62 /// User statistics sessions keyed by agent ID 62 /// User statistics sessions keyed by agent ID
63 /// </summary> 63 /// </summary>
64 private Dictionary<UUID, UserSessionID> m_sessions = new Dictionary<UUID, UserSessionID>(); 64 private Dictionary<UUID, UserSession> m_sessions = new Dictionary<UUID, UserSession>();
65 65
66 private List<Scene> m_scenes = new List<Scene>(); 66 private List<Scene> m_scenes = new List<Scene>();
67 private Dictionary<string, IStatsController> reports = new Dictionary<string, IStatsController>(); 67 private Dictionary<string, IStatsController> reports = new Dictionary<string, IStatsController>();
@@ -319,14 +319,18 @@ namespace OpenSim.Region.UserStatistics
319 319
320 private void OnMakeRootAgent(ScenePresence agent) 320 private void OnMakeRootAgent(ScenePresence agent)
321 { 321 {
322// m_log.DebugFormat(
323// "[WEB STATS MODULE]: Looking for session {0} for {1} in {2}",
324// agent.ControllingClient.SessionId, agent.Name, agent.Scene.Name);
325
322 lock (m_sessions) 326 lock (m_sessions)
323 { 327 {
324 UserSessionID uid; 328 UserSession uid;
325 329
326 if (!m_sessions.ContainsKey(agent.UUID)) 330 if (!m_sessions.ContainsKey(agent.UUID))
327 { 331 {
328 UserSessionData usd = UserSessionUtil.newUserSessionData(); 332 UserSessionData usd = UserSessionUtil.newUserSessionData();
329 uid = new UserSessionID(); 333 uid = new UserSession();
330 uid.name_f = agent.Firstname; 334 uid.name_f = agent.Firstname;
331 uid.name_l = agent.Lastname; 335 uid.name_l = agent.Lastname;
332 uid.session_data = usd; 336 uid.session_data = usd;
@@ -411,9 +415,9 @@ namespace OpenSim.Region.UserStatistics
411 return String.Empty; 415 return String.Empty;
412 } 416 }
413 417
414 private UserSessionID ParseViewerStats(string request, UUID agentID) 418 private UserSession ParseViewerStats(string request, UUID agentID)
415 { 419 {
416 UserSessionID uid = new UserSessionID(); 420 UserSession uid = new UserSession();
417 UserSessionData usd; 421 UserSessionData usd;
418 OSD message = OSDParser.DeserializeLLSDXml(request); 422 OSD message = OSDParser.DeserializeLLSDXml(request);
419 OSDMap mmap; 423 OSDMap mmap;
@@ -425,22 +429,25 @@ namespace OpenSim.Region.UserStatistics
425 if (!m_sessions.ContainsKey(agentID)) 429 if (!m_sessions.ContainsKey(agentID))
426 { 430 {
427 m_log.WarnFormat("[WEB STATS MODULE]: no session for stat disclosure for agent {0}", agentID); 431 m_log.WarnFormat("[WEB STATS MODULE]: no session for stat disclosure for agent {0}", agentID);
428 return new UserSessionID(); 432 return new UserSession();
429 } 433 }
434
430 uid = m_sessions[agentID]; 435 uid = m_sessions[agentID];
436
437// m_log.DebugFormat("[WEB STATS MODULE]: Got session {0} for {1}", uid.session_id, agentID);
431 } 438 }
432 else 439 else
433 { 440 {
434 // parse through the beginning to locate the session 441 // parse through the beginning to locate the session
435 if (message.Type != OSDType.Map) 442 if (message.Type != OSDType.Map)
436 return new UserSessionID(); 443 return new UserSession();
437 444
438 mmap = (OSDMap)message; 445 mmap = (OSDMap)message;
439 { 446 {
440 UUID sessionID = mmap["session_id"].AsUUID(); 447 UUID sessionID = mmap["session_id"].AsUUID();
441 448
442 if (sessionID == UUID.Zero) 449 if (sessionID == UUID.Zero)
443 return new UserSessionID(); 450 return new UserSession();
444 451
445 452
446 // search through each session looking for the owner 453 // search through each session looking for the owner
@@ -459,7 +466,7 @@ namespace OpenSim.Region.UserStatistics
459 // can't find a session 466 // can't find a session
460 if (agentID == UUID.Zero) 467 if (agentID == UUID.Zero)
461 { 468 {
462 return new UserSessionID(); 469 return new UserSession();
463 } 470 }
464 } 471 }
465 } 472 }
@@ -468,12 +475,12 @@ namespace OpenSim.Region.UserStatistics
468 usd = uid.session_data; 475 usd = uid.session_data;
469 476
470 if (message.Type != OSDType.Map) 477 if (message.Type != OSDType.Map)
471 return new UserSessionID(); 478 return new UserSession();
472 479
473 mmap = (OSDMap)message; 480 mmap = (OSDMap)message;
474 { 481 {
475 if (mmap["agent"].Type != OSDType.Map) 482 if (mmap["agent"].Type != OSDType.Map)
476 return new UserSessionID(); 483 return new UserSession();
477 OSDMap agent_map = (OSDMap)mmap["agent"]; 484 OSDMap agent_map = (OSDMap)mmap["agent"];
478 usd.agent_id = agentID; 485 usd.agent_id = agentID;
479 usd.name_f = uid.name_f; 486 usd.name_f = uid.name_f;
@@ -493,17 +500,18 @@ namespace OpenSim.Region.UserStatistics
493 (float)agent_map["fps"].AsReal()); 500 (float)agent_map["fps"].AsReal());
494 501
495 if (mmap["downloads"].Type != OSDType.Map) 502 if (mmap["downloads"].Type != OSDType.Map)
496 return new UserSessionID(); 503 return new UserSession();
497 OSDMap downloads_map = (OSDMap)mmap["downloads"]; 504 OSDMap downloads_map = (OSDMap)mmap["downloads"];
498 usd.d_object_kb = (float)downloads_map["object_kbytes"].AsReal(); 505 usd.d_object_kb = (float)downloads_map["object_kbytes"].AsReal();
499 usd.d_texture_kb = (float)downloads_map["texture_kbytes"].AsReal(); 506 usd.d_texture_kb = (float)downloads_map["texture_kbytes"].AsReal();
500 usd.d_world_kb = (float)downloads_map["workd_kbytes"].AsReal(); 507 usd.d_world_kb = (float)downloads_map["workd_kbytes"].AsReal();
501 508
509// m_log.DebugFormat("[WEB STATS MODULE]: mmap[\"session_id\"] = [{0}]", mmap["session_id"].AsUUID());
502 510
503 usd.session_id = mmap["session_id"].AsUUID(); 511 usd.session_id = mmap["session_id"].AsUUID();
504 512
505 if (mmap["system"].Type != OSDType.Map) 513 if (mmap["system"].Type != OSDType.Map)
506 return new UserSessionID(); 514 return new UserSession();
507 OSDMap system_map = (OSDMap)mmap["system"]; 515 OSDMap system_map = (OSDMap)mmap["system"];
508 516
509 usd.s_cpu = system_map["cpu"].AsString(); 517 usd.s_cpu = system_map["cpu"].AsString();
@@ -512,13 +520,13 @@ namespace OpenSim.Region.UserStatistics
512 usd.s_ram = system_map["ram"].AsInteger(); 520 usd.s_ram = system_map["ram"].AsInteger();
513 521
514 if (mmap["stats"].Type != OSDType.Map) 522 if (mmap["stats"].Type != OSDType.Map)
515 return new UserSessionID(); 523 return new UserSession();
516 524
517 OSDMap stats_map = (OSDMap)mmap["stats"]; 525 OSDMap stats_map = (OSDMap)mmap["stats"];
518 { 526 {
519 527
520 if (stats_map["failures"].Type != OSDType.Map) 528 if (stats_map["failures"].Type != OSDType.Map)
521 return new UserSessionID(); 529 return new UserSession();
522 OSDMap stats_failures = (OSDMap)stats_map["failures"]; 530 OSDMap stats_failures = (OSDMap)stats_map["failures"];
523 usd.f_dropped = stats_failures["dropped"].AsInteger(); 531 usd.f_dropped = stats_failures["dropped"].AsInteger();
524 usd.f_failed_resends = stats_failures["failed_resends"].AsInteger(); 532 usd.f_failed_resends = stats_failures["failed_resends"].AsInteger();
@@ -527,18 +535,18 @@ namespace OpenSim.Region.UserStatistics
527 usd.f_send_packet = stats_failures["send_packet"].AsInteger(); 535 usd.f_send_packet = stats_failures["send_packet"].AsInteger();
528 536
529 if (stats_map["net"].Type != OSDType.Map) 537 if (stats_map["net"].Type != OSDType.Map)
530 return new UserSessionID(); 538 return new UserSession();
531 OSDMap stats_net = (OSDMap)stats_map["net"]; 539 OSDMap stats_net = (OSDMap)stats_map["net"];
532 { 540 {
533 if (stats_net["in"].Type != OSDType.Map) 541 if (stats_net["in"].Type != OSDType.Map)
534 return new UserSessionID(); 542 return new UserSession();
535 543
536 OSDMap net_in = (OSDMap)stats_net["in"]; 544 OSDMap net_in = (OSDMap)stats_net["in"];
537 usd.n_in_kb = (float)net_in["kbytes"].AsReal(); 545 usd.n_in_kb = (float)net_in["kbytes"].AsReal();
538 usd.n_in_pk = net_in["packets"].AsInteger(); 546 usd.n_in_pk = net_in["packets"].AsInteger();
539 547
540 if (stats_net["out"].Type != OSDType.Map) 548 if (stats_net["out"].Type != OSDType.Map)
541 return new UserSessionID(); 549 return new UserSession();
542 OSDMap net_out = (OSDMap)stats_net["out"]; 550 OSDMap net_out = (OSDMap)stats_net["out"];
543 551
544 usd.n_out_kb = (float)net_out["kbytes"].AsReal(); 552 usd.n_out_kb = (float)net_out["kbytes"].AsReal();
@@ -549,11 +557,18 @@ namespace OpenSim.Region.UserStatistics
549 557
550 uid.session_data = usd; 558 uid.session_data = usd;
551 m_sessions[agentID] = uid; 559 m_sessions[agentID] = uid;
560
561// m_log.DebugFormat(
562// "[WEB STATS MODULE]: Parse data for {0} {1}, session {2}", uid.name_f, uid.name_l, uid.session_id);
563
552 return uid; 564 return uid;
553 } 565 }
554 566
555 private void UpdateUserStats(UserSessionID uid, SqliteConnection db) 567 private void UpdateUserStats(UserSession uid, SqliteConnection db)
556 { 568 {
569// m_log.DebugFormat(
570// "[WEB STATS MODULE]: Updating user stats for {0} {1}, session {2}", uid.name_f, uid.name_l, uid.session_id);
571
557 if (uid.session_id == UUID.Zero) 572 if (uid.session_id == UUID.Zero)
558 return; 573 return;
559 574
@@ -740,7 +755,6 @@ VALUES
740 s.min_ping = ArrayMin_f(__ping); 755 s.min_ping = ArrayMin_f(__ping);
741 s.max_ping = ArrayMax_f(__ping); 756 s.max_ping = ArrayMax_f(__ping);
742 s.mode_ping = ArrayMode_f(__ping); 757 s.mode_ping = ArrayMode_f(__ping);
743
744 } 758 }
745 759
746 #region Statistics 760 #region Statistics
@@ -985,7 +999,7 @@ VALUES
985 } 999 }
986 #region structs 1000 #region structs
987 1001
988 public struct UserSessionID 1002 public class UserSession
989 { 1003 {
990 public UUID session_id; 1004 public UUID session_id;
991 public UUID region_id; 1005 public UUID region_id;