From f78d2ef166a523397c770858176eff646be4021d Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 25 Jun 2013 00:46:15 +0100 Subject: Update temporary "Unknown UserUMMTGUN2" name to "Unknown UserUMMTGUN3" to see if Diva's recent HG updates (post 6c7e33f) fix this issue. This string is returned if a UserManagementModule.TryGetUserNames() cannot find a server-side name binding or a user account for a given UUID. This is only called when the viewer requests a binding via the UDP UUIDNameRequest message --- .../Region/CoreModules/Framework/UserManagement/UserManagementModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index 864e181..194b591 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs @@ -320,7 +320,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement else { names[0] = "Unknown"; - names[1] = "UserUMMTGUN2"; + names[1] = "UserUMMTGUN3"; return false; } -- cgit v1.1 From f7d09b898ad6df32b3f07cb64657623980178c2f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 27 Jun 2013 23:14:28 +0100 Subject: Make the concept of namespaces explicit in dynamic attributes This is in order to reduce the likelihood of naming clashes, make it easier to filter in/out attributes, ensure uniformity, etc. All dynattrs in the opensim distro itself or likely future ones should be in the "OpenSim" namespace. This does alter the underlying dynattrs data structure. All data in previous structures may not be available, though old structures should not cause errors. This is done without notice since this feature has been explicitly labelled as experimental, subject to change and has not been in a release. However, existing materials data is being preserved by moving it to the "Materials" store in the "OpenSim" namespace. --- .../Framework/DynamicAttributes/DAExampleModule.cs | 17 ++++++--- .../Framework/DynamicAttributes/DOExampleModule.cs | 8 ++-- .../World/Serialiser/Tests/SerialiserTests.cs | 44 ++++++++++++++++++---- 3 files changed, 51 insertions(+), 18 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DAExampleModule.cs b/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DAExampleModule.cs index 1f1568f..0c632b1 100644 --- a/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DAExampleModule.cs +++ b/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DAExampleModule.cs @@ -44,11 +44,12 @@ namespace OpenSim.Region.CoreModules.Framework.DynamicAttributes.DAExampleModule [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "DAExampleModule")] public class DAExampleModule : INonSharedRegionModule { -// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - private static readonly bool ENABLED = false; // enable for testing + private readonly bool ENABLED = false; // enable for testing - public const string DANamespace = "DAExample Module"; + public const string Namespace = "Example"; + public const string StoreName = "DA"; protected Scene m_scene; protected IDialogModule m_dialogMod; @@ -65,6 +66,8 @@ namespace OpenSim.Region.CoreModules.Framework.DynamicAttributes.DAExampleModule m_scene = scene; m_scene.EventManager.OnSceneGroupMove += OnSceneGroupMove; m_dialogMod = m_scene.RequestModuleInterface(); + + m_log.DebugFormat("[DA EXAMPLE MODULE]: Added region {0}", m_scene.Name); } } @@ -91,7 +94,7 @@ namespace OpenSim.Region.CoreModules.Framework.DynamicAttributes.DAExampleModule if (sop == null) return true; - if (!sop.DynAttrs.TryGetValue(DANamespace, out attrs)) + if (!sop.DynAttrs.TryGetStore(Namespace, StoreName, out attrs)) attrs = new OSDMap(); OSDInteger newValue; @@ -106,12 +109,14 @@ namespace OpenSim.Region.CoreModules.Framework.DynamicAttributes.DAExampleModule attrs["moves"] = newValue; - sop.DynAttrs[DANamespace] = attrs; + sop.DynAttrs.SetStore(Namespace, StoreName, attrs); } sop.ParentGroup.HasGroupChanged = true; - m_dialogMod.SendGeneralAlert(string.Format("{0} {1} moved {2} times", sop.Name, sop.UUID, newValue)); + string msg = string.Format("{0} {1} moved {2} times", sop.Name, sop.UUID, newValue); + m_log.DebugFormat("[DA EXAMPLE MODULE]: {0}", msg); + m_dialogMod.SendGeneralAlert(msg); return true; } diff --git a/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DOExampleModule.cs b/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DOExampleModule.cs index 650aa35..166a994 100644 --- a/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DOExampleModule.cs +++ b/OpenSim/Region/CoreModules/Framework/DynamicAttributes/DOExampleModule.cs @@ -64,8 +64,8 @@ namespace OpenSim.Region.Framework.DynamicAttributes.DOExampleModule private Scene m_scene; private IDialogModule m_dialogMod; - - public string Name { get { return "DOExample Module"; } } + + public string Name { get { return "DO"; } } public Type ReplaceableInterface { get { return null; } } public void Initialise(IConfigSource source) {} @@ -106,7 +106,7 @@ namespace OpenSim.Region.Framework.DynamicAttributes.DOExampleModule // Console.WriteLine("Here for {0}", so.Name); - if (rootPart.DynAttrs.TryGetValue(DAExampleModule.DANamespace, out attrs)) + if (rootPart.DynAttrs.TryGetStore(DAExampleModule.Namespace, DAExampleModule.StoreName, out attrs)) { movesSoFar = attrs["moves"].AsInteger(); @@ -114,7 +114,7 @@ namespace OpenSim.Region.Framework.DynamicAttributes.DOExampleModule "[DO EXAMPLE MODULE]: Found saved moves {0} for {1} in {2}", movesSoFar, so.Name, m_scene.Name); } - rootPart.DynObjs.Add(Name, new MyObject(movesSoFar)); + rootPart.DynObjs.Add(DAExampleModule.Namespace, Name, new MyObject(movesSoFar)); } private bool OnSceneGroupMove(UUID groupId, Vector3 delta) diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs index b4348c9..66059fb 100644 --- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs +++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs @@ -144,7 +144,20 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests None 00000000-0000-0000-0000-000000000000 0 - MyStorethe answer42 + + + + MyNamespace + + MyStore + + the answer + 42 + + + + + @@ -333,7 +346,20 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests 0 2147483647 None - MyStorelast wordsRosebud + + + + MyNamespace + + MyStore + + last words + Rosebud + + + + + 00000000-0000-0000-0000-000000000000 @@ -362,7 +388,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests Assert.That(rootPart.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790"))); Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("a6dacf01-4636-4bb9-8a97-30609438af9d"))); Assert.That(rootPart.Name, Is.EqualTo("PrimMyRide")); - OSDMap store = rootPart.DynAttrs["MyStore"]; + OSDMap store = rootPart.DynAttrs.GetStore("MyNamespace", "MyStore"); Assert.AreEqual(42, store["the answer"].AsInteger()); // TODO: Check other properties @@ -414,13 +440,14 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests rp.CreatorID = rpCreatorId; rp.Shape = shape; + string daNamespace = "MyNamespace"; string daStoreName = "MyStore"; string daKey = "foo"; string daValue = "bar"; OSDMap myStore = new OSDMap(); myStore.Add(daKey, daValue); rp.DynAttrs = new DAMap(); - rp.DynAttrs[daStoreName] = myStore; + rp.DynAttrs.SetStore(daNamespace, daStoreName, myStore); SceneObjectGroup so = new SceneObjectGroup(rp); @@ -481,7 +508,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests Assert.That(name, Is.EqualTo(rpName)); Assert.That(creatorId, Is.EqualTo(rpCreatorId)); Assert.NotNull(daMap); - Assert.AreEqual(daValue, daMap[daStoreName][daKey].AsString()); + Assert.AreEqual(daValue, daMap.GetStore(daNamespace, daStoreName)[daKey].AsString()); } [Test] @@ -496,7 +523,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests Assert.That(rootPart.UUID, Is.EqualTo(new UUID("9be68fdd-f740-4a0f-9675-dfbbb536b946"))); Assert.That(rootPart.CreatorID, Is.EqualTo(new UUID("b46ef588-411e-4a8b-a284-d7dcfe8e74ef"))); Assert.That(rootPart.Name, Is.EqualTo("PrimFun")); - OSDMap store = rootPart.DynAttrs["MyStore"]; + OSDMap store = rootPart.DynAttrs.GetStore("MyNamespace", "MyStore"); Assert.AreEqual("Rosebud", store["last words"].AsString()); // TODO: Check other properties @@ -522,13 +549,14 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests rp.CreatorID = rpCreatorId; rp.Shape = shape; + string daNamespace = "MyNamespace"; string daStoreName = "MyStore"; string daKey = "foo"; string daValue = "bar"; OSDMap myStore = new OSDMap(); myStore.Add(daKey, daValue); rp.DynAttrs = new DAMap(); - rp.DynAttrs[daStoreName] = myStore; + rp.DynAttrs.SetStore(daNamespace, daStoreName, myStore); SceneObjectGroup so = new SceneObjectGroup(rp); @@ -585,7 +613,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests Assert.That(name, Is.EqualTo(rpName)); Assert.That(creatorId, Is.EqualTo(rpCreatorId)); Assert.NotNull(daMap); - Assert.AreEqual(daValue, daMap[daStoreName][daKey].AsString()); + Assert.AreEqual(daValue, daMap.GetStore(daNamespace, daStoreName)[daKey].AsString()); } } } \ No newline at end of file -- cgit v1.1 From 0c9702156581cd3948fe07bdae23f3530105d2b5 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 29 Jun 2013 21:05:45 -0700 Subject: More debug for mantis #6625. It looks like the home friends list is being fetched on HG TPs. --- .../CoreModules/Avatar/Friends/HGFriendsModule.cs | 41 +++++++++++----------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs index b3e3aa2..ae45b99 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/HGFriendsModule.cs @@ -183,6 +183,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends if (Util.ParseUniversalUserIdentifier(finfo.Friend, out id, out url, out first, out last, out tmp)) { IUserManagement uMan = m_Scenes[0].RequestModuleInterface(); + m_log.DebugFormat("[HGFRIENDS MODULE]: caching {0}", finfo.Friend); uMan.AddUser(id, url + ";" + first + " " + last); } } @@ -347,31 +348,31 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends return null; } - public override FriendInfo[] GetFriendsFromService(IClientAPI client) - { -// m_log.DebugFormat("[HGFRIENDS MODULE]: Entering GetFriendsFromService for {0}", client.Name); - Boolean agentIsLocal = true; - if (UserManagementModule != null) - agentIsLocal = UserManagementModule.IsLocalGridUser(client.AgentId); +// public override FriendInfo[] GetFriendsFromService(IClientAPI client) +// { +//// m_log.DebugFormat("[HGFRIENDS MODULE]: Entering GetFriendsFromService for {0}", client.Name); +// Boolean agentIsLocal = true; +// if (UserManagementModule != null) +// agentIsLocal = UserManagementModule.IsLocalGridUser(client.AgentId); - if (agentIsLocal) - return base.GetFriendsFromService(client); +// if (agentIsLocal) +// return base.GetFriendsFromService(client); - FriendInfo[] finfos = new FriendInfo[0]; - // Foreigner - AgentCircuitData agentClientCircuit = ((Scene)(client.Scene)).AuthenticateHandler.GetAgentCircuitData(client.CircuitCode); - if (agentClientCircuit != null) - { - //[XXX] string agentUUI = Util.ProduceUserUniversalIdentifier(agentClientCircuit); +// FriendInfo[] finfos = new FriendInfo[0]; +// // Foreigner +// AgentCircuitData agentClientCircuit = ((Scene)(client.Scene)).AuthenticateHandler.GetAgentCircuitData(client.CircuitCode); +// if (agentClientCircuit != null) +// { +// //[XXX] string agentUUI = Util.ProduceUserUniversalIdentifier(agentClientCircuit); - finfos = FriendsService.GetFriends(client.AgentId.ToString()); - m_log.DebugFormat("[HGFRIENDS MODULE]: Fetched {0} local friends for visitor {1}", finfos.Length, client.AgentId.ToString()); - } +// finfos = FriendsService.GetFriends(client.AgentId.ToString()); +// m_log.DebugFormat("[HGFRIENDS MODULE]: Fetched {0} local friends for visitor {1}", finfos.Length, client.AgentId.ToString()); +// } -// m_log.DebugFormat("[HGFRIENDS MODULE]: Exiting GetFriendsFromService for {0}", client.Name); +//// m_log.DebugFormat("[HGFRIENDS MODULE]: Exiting GetFriendsFromService for {0}", client.Name); - return finfos; - } +// return finfos; +// } protected override bool StoreRights(UUID agentID, UUID friendID, int rights) { -- cgit v1.1 From 8fa5d12fcb73ffcc7144009e0147febcfa3ce704 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 29 Jun 2013 21:26:58 -0700 Subject: One more debug mantis #6625 --- OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 41ea2a2..50371ce 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -292,6 +292,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends friendsData = new UserFriendData(); friendsData.PrincipalID = agentID; friendsData.Friends = GetFriendsFromService(client); + m_log.DebugFormat("[FRIENDS MODULE]: User has {1} friends", friendsData.Friends.Length); friendsData.Refcount = 1; m_Friends[agentID] = friendsData; -- cgit v1.1 From c462e0a51ce04a580eab49df6c679c20eff74c8d Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 29 Jun 2013 21:30:07 -0700 Subject: Fixed previous debug message --- OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index 50371ce..d9d302c 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -292,7 +292,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends friendsData = new UserFriendData(); friendsData.PrincipalID = agentID; friendsData.Friends = GetFriendsFromService(client); - m_log.DebugFormat("[FRIENDS MODULE]: User has {1} friends", friendsData.Friends.Length); + m_log.DebugFormat("[FRIENDS MODULE]: User has {0} friends", friendsData.Friends.Length); friendsData.Refcount = 1; m_Friends[agentID] = friendsData; -- cgit v1.1 From 74e7fac13fcb5d15d469d27694fc89d5f784ade0 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 29 Jun 2013 22:32:26 -0700 Subject: More on mantis #6625 --- .../ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs index 2d3ba82..70ba944 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs @@ -204,7 +204,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory Util.FireAndForget(delegate { foreach (InventoryItemBase item in items) - UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); + if (!string.IsNullOrEmpty(item.CreatorData)) + UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); }); } -- cgit v1.1 From 1fc873d09fbc0d29e35d2a8f34c134bb8ac01480 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 30 Jun 2013 07:21:22 -0700 Subject: Same fix to LocalInventoryServiceConnector.cs --- .../ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index ec5751d..99913a9 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs @@ -196,7 +196,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory Util.FireAndForget(delegate { foreach (InventoryItemBase item in items) - UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); + if (!string.IsNullOrEmpty(item.CreatorData)) + UserManager.AddUser(item.CreatorIdAsUuid, item.CreatorData); }); } -- cgit v1.1 From 1e97972f78a852f24664f730f2e502c3b8a680c8 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 30 Jun 2013 07:25:13 -0700 Subject: Revert "One more debug mantis #6625" This reverts commit 8fa5d12fcb73ffcc7144009e0147febcfa3ce704. Conflicts: OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs --- OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs | 1 - 1 file changed, 1 deletion(-) (limited to 'OpenSim/Region/CoreModules') diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs index d9d302c..41ea2a2 100644 --- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs @@ -292,7 +292,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends friendsData = new UserFriendData(); friendsData.PrincipalID = agentID; friendsData.Friends = GetFriendsFromService(client); - m_log.DebugFormat("[FRIENDS MODULE]: User has {0} friends", friendsData.Friends.Length); friendsData.Refcount = 1; m_Friends[agentID] = friendsData; -- cgit v1.1