From 16c9c1dff7bbf299efddd44e4f9aeeb7db38fff6 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 6 Oct 2012 02:34:49 +0100
Subject: On receiving TaskInventoryAccepted with a destination folder in the
 binary bucket slot for RLV, notify the viewer about inventory folder updates.

The viewer would not see the folder move without this, either on accept or decline.
This commit also updates the TaskInventoryOffered message to better conform with the data LL uses
Changes are, agentID is prim owner rather than prim id, agent name is now simply object name rather than name with owner detail,
message is just folder name in single quotes, message is not timestamped.
However, folder is not renamed "still #RLV/~<name>".  Long term solution is probably not to do these operations server-side.
Notes will be added to http://opensimulator.org/mantis/view.php?id=6311
---
 OpenSim/Framework/GridInstantMessage.cs            |  9 ++---
 .../Region/ClientStack/Linden/UDP/LLClientView.cs  |  3 +-
 .../Avatar/Friends/CallingCardModule.cs            |  2 +-
 .../Inventory/Transfer/InventoryTransferModule.cs  | 42 ++++++++++++++++++++++
 .../Region/CoreModules/Avatar/Lure/HGLureModule.cs |  2 +-
 .../Region/CoreModules/Avatar/Lure/LureModule.cs   |  2 +-
 .../EntityTransfer/EntityTransferModule.cs         | 22 +++++++++---
 OpenSim/Region/Framework/Scenes/Scene.Inventory.cs |  2 +-
 .../Region/OptionalModules/World/NPC/NPCAvatar.cs  |  2 +-
 .../Shared/Api/Implementation/LSL_Api.cs           | 19 +++++-----
 10 files changed, 81 insertions(+), 24 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Framework/GridInstantMessage.cs b/OpenSim/Framework/GridInstantMessage.cs
index a6bf6e3..6ae0488 100644
--- a/OpenSim/Framework/GridInstantMessage.cs
+++ b/OpenSim/Framework/GridInstantMessage.cs
@@ -44,7 +44,6 @@ namespace OpenSim.Framework
         public Vector3 Position;
         public byte[] binaryBucket;
 
-
         public uint ParentEstateID;
         public Guid RegionID;
         public uint timestamp;
@@ -58,7 +57,7 @@ namespace OpenSim.Framework
                 string _fromAgentName, UUID _toAgentID,
                 byte _dialog, bool _fromGroup, string _message,
                 UUID _imSessionID, bool _offline, Vector3 _position,
-                byte[] _binaryBucket)
+                byte[] _binaryBucket, bool addTimestamp)
         {
             fromAgentID = _fromAgentID.Guid;
             fromAgentName = _fromAgentName;
@@ -79,7 +78,9 @@ namespace OpenSim.Framework
                 ParentEstateID = scene.RegionInfo.EstateSettings.ParentEstateID;
                 RegionID = scene.RegionInfo.RegionSettings.RegionUUID.Guid;
             }
-            timestamp = (uint)Util.UnixTimeSinceEpoch();
+
+            if (addTimestamp)
+                timestamp = (uint)Util.UnixTimeSinceEpoch();
         }
 
         public GridInstantMessage(IScene scene, UUID _fromAgentID,
@@ -87,7 +88,7 @@ namespace OpenSim.Framework
                 string _message, bool _offline,
                 Vector3 _position) : this(scene, _fromAgentID, _fromAgentName,
                 _toAgentID, _dialog, false, _message,
-                _fromAgentID ^ _toAgentID, _offline, _position, new byte[0])
+                _fromAgentID ^ _toAgentID, _offline, _position, new byte[0], true)
         {
         }
     }
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
                         msgpack.MessageBlock.ID,
                         msgpack.MessageBlock.Offline != 0 ? true : false,
                         msgpack.MessageBlock.Position,
-                        msgpack.MessageBlock.BinaryBucket);
+                        msgpack.MessageBlock.BinaryBucket,
+                        true);
 
                 handlerInstantMessage(this, im);
             }
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
                         client.FirstName+" "+client.LastName,
                         destID, (byte)211, false,
                         String.Empty,
-                        transactionID, false, new Vector3(), new byte[0]),
+                        transactionID, false, new Vector3(), new byte[0], true),
                         delegate(bool success) {} );
             }
         }
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
                         });
                 }
             }
+
+            // XXX: This code was placed here to try and accomdate RLV which moves given folders named #RLV/~<name>
+            // to a folder called name in #RLV.  However, this approach may not be ultimately correct - from analysis
+            // of Firestorm 4.2.2 on sending an InventoryOffered instead of TaskInventoryOffered (as was previously
+            // done), the viewer itself would appear to move and rename the folder, rather than the simulator doing it here.
             else if (im.dialog == (byte) InstantMessageDialog.TaskInventoryAccepted)
             {
                 UUID destinationFolderID = UUID.Zero;
@@ -308,6 +313,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
 
                 if (destinationFolderID != UUID.Zero)
                 {
+                    InventoryFolderBase destinationFolder = new InventoryFolderBase(destinationFolderID, client.AgentId);
+                    if (destinationFolder == null)
+                    {
+                        m_log.WarnFormat(
+                            "[INVENTORY TRANSFER]: TaskInventoryAccepted message from {0} in {1} specified folder {2} which does not exist",
+                            client.Name, scene.Name, destinationFolderID);
+
+                        return;
+                    }
+
                     IInventoryService invService = scene.InventoryService;
 
                     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
                     InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId);
                     item = invService.GetItem(item);
                     InventoryFolderBase folder = null;
+                    UUID? previousParentFolderID = null;
 
                     if (item != null) // It's an item
                     {
+                        previousParentFolderID = item.Folder;
                         item.Folder = destinationFolderID;
 
                         invService.DeleteItems(item.Owner, new List<UUID>() { item.ID });
@@ -330,10 +347,22 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
 
                         if (folder != null) // It's a folder
                         {
+                            previousParentFolderID = folder.ParentID;
                             folder.ParentID = destinationFolderID;
                             invService.MoveFolder(folder);
                         }
                     }
+
+                    // Tell client about updates to original parent and new parent (this should probably be factored with existing move item/folder code).
+                    if (previousParentFolderID != null)
+                    {
+                        InventoryFolderBase previousParentFolder
+                            = new InventoryFolderBase((UUID)previousParentFolderID, client.AgentId);
+                        previousParentFolder = invService.GetFolder(previousParentFolder);
+                        scene.SendInventoryUpdate(client, previousParentFolder, true, true);
+
+                        scene.SendInventoryUpdate(client, destinationFolder, true, true);
+                    }
                 }
             }
             else if (
@@ -354,9 +383,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
                 InventoryItemBase item = new InventoryItemBase(inventoryID, client.AgentId);
                 item = invService.GetItem(item);
                 InventoryFolderBase folder = null;
+                UUID? previousParentFolderID = null;
                 
                 if (item != null && trashFolder != null)
                 {
+                    previousParentFolderID = item.Folder;
                     item.Folder = trashFolder.ID;
 
                     // Diva comment: can't we just update this item???
@@ -372,6 +403,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
                     
                     if (folder != null & trashFolder != null)
                     {
+                        previousParentFolderID = folder.ParentID;
                         folder.ParentID = trashFolder.ID;
                         invService.MoveFolder(folder);
                     }
@@ -391,6 +423,16 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Transfer
                     client.SendAgentAlertMessage("Unable to delete "+
                             "received inventory" + reason, false);
                 }
+                // Tell client about updates to original parent and new parent (this should probably be factored with existing move item/folder code).
+                else if (previousParentFolderID != null)
+                {
+                    InventoryFolderBase previousParentFolder
+                        = new InventoryFolderBase((UUID)previousParentFolderID, client.AgentId);
+                    previousParentFolder = invService.GetFolder(previousParentFolder);
+                    scene.SendInventoryUpdate(client, previousParentFolder, true, true);
+
+                    scene.SendInventoryUpdate(client, trashFolder, true, true);
+                }
 
                 ScenePresence user = scene.GetScenePresence(new UUID(im.toAgentID));
 
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
                     client.FirstName+" "+client.LastName, targetid,
                     (byte)InstantMessageDialog.RequestTeleport, false,
                     message, sessionID, false, presence.AbsolutePosition,
-                    new Byte[0]);
+                    new Byte[0], true);
             m.RegionID = client.Scene.RegionInfo.RegionID.Guid;
 
             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
                     client.FirstName+" "+client.LastName, targetid,
                     (byte)InstantMessageDialog.RequestTeleport, false,
                     message, dest, false, presence.AbsolutePosition,
-                    new Byte[0]);
+                    new Byte[0], true);
                     
             if (m_TransferModule != null)
             {
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
             Scene initiatingScene)
         {
             Thread.Sleep(10000);
+            
             IMessageTransferModule im = initiatingScene.RequestModuleInterface<IMessageTransferModule>();
             if (im != null)
             {
@@ -1080,11 +1081,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
                     (uint)(int)position.X,
                     (uint)(int)position.Y,
                     (uint)(int)position.Z);
-                GridInstantMessage m = new GridInstantMessage(initiatingScene, UUID.Zero,
-                "Region", agent.UUID,
-                (byte)InstantMessageDialog.GodLikeRequestTeleport, false,
-                "", gotoLocation, false, new Vector3(127, 0, 0),
-                new Byte[0]);
+
+                GridInstantMessage m
+                    = new GridInstantMessage(
+                        initiatingScene,
+                        UUID.Zero,
+                        "Region",
+                        agent.UUID,
+                        (byte)InstantMessageDialog.GodLikeRequestTeleport,
+                        false,
+                        "",
+                        gotoLocation,
+                        false,
+                        new Vector3(127, 0, 0),
+                        new Byte[0],
+                        false);
+
                 im.SendInstantMessage(m, delegate(bool success)
                 {
                     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
             return newFolderID;
         }
 
-        private void SendInventoryUpdate(IClientAPI client, InventoryFolderBase folder, bool fetchFolders, bool fetchItems)
+        public void SendInventoryUpdate(IClientAPI client, InventoryFolderBase folder, bool fetchFolders, bool fetchItems)
         {
             if (folder == null)
                 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
             OnInstantMessage(this, new GridInstantMessage(m_scene,
                     m_uuid, m_firstname + " " + m_lastname,
                     target, 0, false, message,
-                    UUID.Zero, false, Position, new byte[0]));
+                    UUID.Zero, false, Position, new byte[0], true));
         }
 
         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
                             World.RegionInfo.RegionName+" "+
                             m_host.AbsolutePosition.ToString(),
                             agentItem.ID, true, m_host.AbsolutePosition,
-                            bucket);
+                            bucket, true); // TODO: May actually send no timestamp
 
                     m_TransferModule.SendInstantMessage(msg, delegate(bool success) {});
                 }
@@ -6452,16 +6452,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
             if (m_TransferModule != null)
             {
                 byte[] bucket = new byte[] { (byte)AssetType.Folder };
-    
+
+                Vector3 pos = m_host.AbsolutePosition;
+
                 GridInstantMessage msg = new GridInstantMessage(World,
-                        m_host.UUID, m_host.Name + ", an object owned by " +
-                        resolveName(m_host.OwnerID) + ",", destID,
+                        m_host.OwnerID, m_host.Name, destID,
                         (byte)InstantMessageDialog.TaskInventoryOffered,
-                        false, category + "\n" + m_host.Name + " is located at " +
-                        World.RegionInfo.RegionName + " " +
-                        m_host.AbsolutePosition.ToString(),
-                        folderID, true, m_host.AbsolutePosition,
-                        bucket);
+                        false, string.Format("'{0}'"),
+// We won't go so far as to add a SLURL, but this is the format used by LL as of 2012-10-06                                       
+// false, string.Format("'{0}'  ( http://slurl.com/secondlife/{1}/{2}/{3}/{4} )", category, World.Name, (int)pos.X, (int)pos.Y, (int)pos.Z),
+                        folderID, false, pos,
+                        bucket, false);
 
                 m_TransferModule.SendInstantMessage(msg, delegate(bool success) {});
             }
-- 
cgit v1.1


From 9de991301cfcb66721a5593dd9098fe84e090dec Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 6 Oct 2012 04:03:53 +0100
Subject: Make UserSessionID a class rather than a struct, so that later
 updates to value suceed (rather than having to pull the data out and reinsert
 back into the Dictionary).

Fixes http://opensimulator.org/mantis/view.php?id=6338
---
 OpenSim/Region/UserStatistics/WebStatsModule.cs | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs
index c11ea02..b1795db 100644
--- a/OpenSim/Region/UserStatistics/WebStatsModule.cs
+++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs
@@ -319,6 +319,10 @@ namespace OpenSim.Region.UserStatistics
 
         private void OnMakeRootAgent(ScenePresence agent)
         {
+//            m_log.DebugFormat(
+//                "[WEB STATS MODULE]: Looking for session {0} for {1} in {2}",
+//                agent.ControllingClient.SessionId, agent.Name, agent.Scene.Name);
+
             lock (m_sessions)
             {
                 UserSessionID uid;
@@ -427,7 +431,10 @@ namespace OpenSim.Region.UserStatistics
                         m_log.WarnFormat("[WEB STATS MODULE]: no session for stat disclosure for agent {0}", agentID);
                         return new UserSessionID();
                     }
+
                     uid = m_sessions[agentID];
+
+//                    m_log.DebugFormat("[WEB STATS MODULE]: Got session {0} for {1}", uid.session_id, agentID);
                 }
                 else
                 {
@@ -499,6 +506,7 @@ namespace OpenSim.Region.UserStatistics
                 usd.d_texture_kb = (float)downloads_map["texture_kbytes"].AsReal();
                 usd.d_world_kb = (float)downloads_map["workd_kbytes"].AsReal();
 
+//                m_log.DebugFormat("[WEB STATS MODULE]: mmap[\"session_id\"] = [{0}]", mmap["session_id"].AsUUID());
 
                 usd.session_id = mmap["session_id"].AsUUID();
 
@@ -549,11 +557,18 @@ namespace OpenSim.Region.UserStatistics
 
             uid.session_data = usd;
             m_sessions[agentID] = uid;
+
+//            m_log.DebugFormat(
+//                "[WEB STATS MODULE]: Parse data for {0} {1}, session {2}", uid.name_f, uid.name_l, uid.session_id);
+
             return uid;
         }
 
         private void UpdateUserStats(UserSessionID uid, SqliteConnection db)
         {
+//            m_log.DebugFormat(
+//                "[WEB STATS MODULE]: Updating user stats for {0} {1}, session {2}", uid.name_f, uid.name_l, uid.session_id);
+
             if (uid.session_id == UUID.Zero)
                 return;
 
@@ -740,7 +755,6 @@ VALUES
             s.min_ping = ArrayMin_f(__ping);
             s.max_ping = ArrayMax_f(__ping);
             s.mode_ping = ArrayMode_f(__ping);
-
         }
 
         #region Statistics
@@ -985,7 +999,7 @@ VALUES
     }
     #region structs
 
-    public struct UserSessionID
+    public class UserSessionID
     {
         public UUID session_id;
         public UUID region_id;
-- 
cgit v1.1


From 13c4fd7271783d3e2c51da7b9509d08aeedf3131 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 6 Oct 2012 04:06:27 +0100
Subject: refactor: Rename UserSessioNID -> UserSession in WebStatsModule since
 this is what it actually represents

---
 OpenSim/Region/UserStatistics/WebStatsModule.cs | 40 ++++++++++++-------------
 1 file changed, 20 insertions(+), 20 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Region/UserStatistics/WebStatsModule.cs b/OpenSim/Region/UserStatistics/WebStatsModule.cs
index b1795db..625eba4 100644
--- a/OpenSim/Region/UserStatistics/WebStatsModule.cs
+++ b/OpenSim/Region/UserStatistics/WebStatsModule.cs
@@ -61,7 +61,7 @@ namespace OpenSim.Region.UserStatistics
         /// <summary>
         /// User statistics sessions keyed by agent ID
         /// </summary>
-        private Dictionary<UUID, UserSessionID> m_sessions = new Dictionary<UUID, UserSessionID>();
+        private Dictionary<UUID, UserSession> m_sessions = new Dictionary<UUID, UserSession>();
 
         private List<Scene> m_scenes = new List<Scene>();
         private Dictionary<string, IStatsController> reports = new Dictionary<string, IStatsController>();
@@ -325,12 +325,12 @@ namespace OpenSim.Region.UserStatistics
 
             lock (m_sessions)
             {
-                UserSessionID uid;
+                UserSession uid;
 
                 if (!m_sessions.ContainsKey(agent.UUID))
                 {
                     UserSessionData usd = UserSessionUtil.newUserSessionData();
-                    uid = new UserSessionID();
+                    uid = new UserSession();
                     uid.name_f = agent.Firstname;
                     uid.name_l = agent.Lastname;
                     uid.session_data = usd;
@@ -415,9 +415,9 @@ namespace OpenSim.Region.UserStatistics
             return String.Empty;
         }
 
-        private UserSessionID ParseViewerStats(string request, UUID agentID)
+        private UserSession ParseViewerStats(string request, UUID agentID)
         {
-            UserSessionID uid = new UserSessionID();
+            UserSession uid = new UserSession();
             UserSessionData usd;
             OSD message = OSDParser.DeserializeLLSDXml(request);
             OSDMap mmap;
@@ -429,7 +429,7 @@ namespace OpenSim.Region.UserStatistics
                     if (!m_sessions.ContainsKey(agentID))
                     {
                         m_log.WarnFormat("[WEB STATS MODULE]: no session for stat disclosure for agent {0}", agentID);
-                        return new UserSessionID();
+                        return new UserSession();
                     }
 
                     uid = m_sessions[agentID];
@@ -440,14 +440,14 @@ namespace OpenSim.Region.UserStatistics
                 {
                     // parse through the beginning to locate the session
                     if (message.Type != OSDType.Map)
-                        return new UserSessionID();
+                        return new UserSession();
 
                     mmap = (OSDMap)message;
                     {
                         UUID sessionID = mmap["session_id"].AsUUID();
 
                         if (sessionID == UUID.Zero)
-                            return new UserSessionID();
+                            return new UserSession();
 
 
                         // search through each session looking for the owner
@@ -466,7 +466,7 @@ namespace OpenSim.Region.UserStatistics
                         // can't find a session
                         if (agentID == UUID.Zero)
                         {
-                            return new UserSessionID();
+                            return new UserSession();
                         }
                     }
                 }
@@ -475,12 +475,12 @@ namespace OpenSim.Region.UserStatistics
             usd = uid.session_data;
 
             if (message.Type != OSDType.Map)
-                return new UserSessionID();
+                return new UserSession();
 
             mmap = (OSDMap)message;
             {
                 if (mmap["agent"].Type != OSDType.Map)
-                    return new UserSessionID();
+                    return new UserSession();
                 OSDMap agent_map = (OSDMap)mmap["agent"];
                 usd.agent_id = agentID;
                 usd.name_f = uid.name_f;
@@ -500,7 +500,7 @@ namespace OpenSim.Region.UserStatistics
                                                  (float)agent_map["fps"].AsReal());
 
                 if (mmap["downloads"].Type != OSDType.Map)
-                    return new UserSessionID();
+                    return new UserSession();
                 OSDMap downloads_map = (OSDMap)mmap["downloads"];
                 usd.d_object_kb = (float)downloads_map["object_kbytes"].AsReal();
                 usd.d_texture_kb = (float)downloads_map["texture_kbytes"].AsReal();
@@ -511,7 +511,7 @@ namespace OpenSim.Region.UserStatistics
                 usd.session_id = mmap["session_id"].AsUUID();
 
                 if (mmap["system"].Type != OSDType.Map)
-                    return new UserSessionID();
+                    return new UserSession();
                 OSDMap system_map = (OSDMap)mmap["system"];
 
                 usd.s_cpu = system_map["cpu"].AsString();
@@ -520,13 +520,13 @@ namespace OpenSim.Region.UserStatistics
                 usd.s_ram = system_map["ram"].AsInteger();
 
                 if (mmap["stats"].Type != OSDType.Map)
-                    return new UserSessionID();
+                    return new UserSession();
 
                 OSDMap stats_map = (OSDMap)mmap["stats"];
                 {
 
                     if (stats_map["failures"].Type != OSDType.Map)
-                        return new UserSessionID();
+                        return new UserSession();
                     OSDMap stats_failures = (OSDMap)stats_map["failures"];
                     usd.f_dropped = stats_failures["dropped"].AsInteger();
                     usd.f_failed_resends = stats_failures["failed_resends"].AsInteger();
@@ -535,18 +535,18 @@ namespace OpenSim.Region.UserStatistics
                     usd.f_send_packet = stats_failures["send_packet"].AsInteger();
 
                     if (stats_map["net"].Type != OSDType.Map)
-                        return new UserSessionID();
+                        return new UserSession();
                     OSDMap stats_net = (OSDMap)stats_map["net"];
                     {
                         if (stats_net["in"].Type != OSDType.Map)
-                            return new UserSessionID();
+                            return new UserSession();
 
                         OSDMap net_in = (OSDMap)stats_net["in"];
                         usd.n_in_kb = (float)net_in["kbytes"].AsReal();
                         usd.n_in_pk = net_in["packets"].AsInteger();
 
                         if (stats_net["out"].Type != OSDType.Map)
-                            return new UserSessionID();
+                            return new UserSession();
                         OSDMap net_out = (OSDMap)stats_net["out"];
 
                         usd.n_out_kb = (float)net_out["kbytes"].AsReal();
@@ -564,7 +564,7 @@ namespace OpenSim.Region.UserStatistics
             return uid;
         }
 
-        private void UpdateUserStats(UserSessionID uid, SqliteConnection db)
+        private void UpdateUserStats(UserSession uid, SqliteConnection db)
         {
 //            m_log.DebugFormat(
 //                "[WEB STATS MODULE]: Updating user stats for {0} {1}, session {2}", uid.name_f, uid.name_l, uid.session_id);
@@ -999,7 +999,7 @@ VALUES
     }
     #region structs
 
-    public class UserSessionID
+    public class UserSession
     {
         public UUID session_id;
         public UUID region_id;
-- 
cgit v1.1


From 90a39379f0976a00582e2096da4498395d71c109 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Mon, 8 Oct 2012 17:36:40 +0100
Subject: Allow other whitespace characters than spaces in Robust connection
 string

---
 OpenSim/Server/ServerMain.cs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Server/ServerMain.cs b/OpenSim/Server/ServerMain.cs
index 21fb678..365a79a 100644
--- a/OpenSim/Server/ServerMain.cs
+++ b/OpenSim/Server/ServerMain.cs
@@ -60,7 +60,7 @@ namespace OpenSim.Server
             }
 
             string connList = serverConfig.GetString("ServiceConnectors", String.Empty);
-            string[] conns = connList.Split(new char[] {',', ' '});
+            string[] conns = connList.Split(new char[] {',', ' ', '\n', '\r', '\t'});
 
 //            int i = 0;
             foreach (string c in conns)
@@ -130,4 +130,4 @@ namespace OpenSim.Server
             return 0;
         }
     }
-}
\ No newline at end of file
+}
-- 
cgit v1.1


From ff92330523a3375b88dca017ed56d52e0859b561 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Mon, 8 Oct 2012 17:57:22 +0100
Subject: Add a ServiceList section to Robust .ini to get rid of the long
 string

---
 OpenSim/Server/ServerMain.cs | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

(limited to 'OpenSim')

diff --git a/OpenSim/Server/ServerMain.cs b/OpenSim/Server/ServerMain.cs
index 365a79a..552e3a2 100644
--- a/OpenSim/Server/ServerMain.cs
+++ b/OpenSim/Server/ServerMain.cs
@@ -60,6 +60,24 @@ namespace OpenSim.Server
             }
 
             string connList = serverConfig.GetString("ServiceConnectors", String.Empty);
+
+            IConfig servicesConfig = m_Server.Config.Configs["ServiceList"];
+            if (servicesConfig != null)
+            {
+                List<string> servicesList = new List<string>();
+                if (connList != String.Empty)
+                    servicesList.Add(connList);
+
+                foreach (string k in servicesConfig.GetKeys())
+                {
+                    string v = servicesConfig.GetString(k);
+                    if (v != String.Empty)
+                        servicesList.Add(v);
+                }
+
+                connList = servicesConfig.Join(",");
+            }
+
             string[] conns = connList.Split(new char[] {',', ' ', '\n', '\r', '\t'});
 
 //            int i = 0;
-- 
cgit v1.1


From f65218f8265e0dfb03f6a779d0190af36c866244 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Mon, 8 Oct 2012 19:02:21 +0100
Subject: Fix build break

---
 OpenSim/Server/ServerMain.cs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'OpenSim')

diff --git a/OpenSim/Server/ServerMain.cs b/OpenSim/Server/ServerMain.cs
index 552e3a2..45c13fb 100644
--- a/OpenSim/Server/ServerMain.cs
+++ b/OpenSim/Server/ServerMain.cs
@@ -75,7 +75,7 @@ namespace OpenSim.Server
                         servicesList.Add(v);
                 }
 
-                connList = servicesConfig.Join(",");
+                connList = String.Join(",", servicesList.ToArray());
             }
 
             string[] conns = connList.Split(new char[] {',', ' ', '\n', '\r', '\t'});
-- 
cgit v1.1