From c3e74d9e044618b012f38d3d00aeac2dd212bf45 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Wed, 7 Aug 2019 18:19:56 +0100 Subject: [PATCH] Put a scope un users. Should fix Unknown UserUMMAU43 unless the user IS unknown --- OpenSim/Framework/IClientAPI.cs | 1 + OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 6 ++++++ .../Framework/UserManagement/UserManagementModule.cs | 11 ++++++++--- .../InternetRelayClientView/Server/IRCClientView.cs | 2 ++ OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs | 7 +++++++ OpenSim/Tests/Common/Mock/TestClient.cs | 5 +++++ 6 files changed, 29 insertions(+), 3 deletions(-) mode change 100644 => 100755 OpenSim/Framework/IClientAPI.cs mode change 100644 => 100755 OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs mode change 100644 => 100755 OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs mode change 100644 => 100755 OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs mode change 100644 => 100755 OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs mode change 100644 => 100755 OpenSim/Tests/Common/Mock/TestClient.cs diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs old mode 100644 new mode 100755 index 68ca52e2ee..da964e731f --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -712,6 +712,7 @@ namespace OpenSim.Framework UUID AgentId { get; } + UUID ScopeId { get; } /// /// The scene agent for this client. This will only be set if the client has an agent in a scene (i.e. if it /// is connected). diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs old mode 100644 new mode 100755 index aeb728e8d1..31f08aff87 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -331,6 +331,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP private readonly UUID m_sessionId; private readonly UUID m_secureSessionId; protected readonly UUID m_agentId; + protected readonly UUID m_scopeId; private readonly uint m_circuitCode; private readonly byte[] m_regionChannelVersion = Utils.EmptyBytes; private readonly IGroupsModule m_GroupsModule; @@ -419,6 +420,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } public UUID AgentId { get { return m_agentId; } } + public UUID ScopeId { get { return m_scopeId; } } public ISceneAgent SceneAgent { get; set; } public UUID ActiveGroupId { get { return m_activeGroupID; } set { m_activeGroupID = value; } } public string ActiveGroupName { get { return m_activeGroupName; } set { m_activeGroupName = value; } } @@ -552,6 +554,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_prioritizer = new Prioritizer(m_scene); + // Pick up agent scope which, for gods, can be different from the region scope + IUserAccountService userAccountService = m_scene.RequestModuleInterface(); + var myself = userAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_agentId); + RegisterLocalPacketHandlers(); string name = string.Format("AsyncInUDP-{0}",m_agentId.ToString()); m_asyncPacketProcess = new JobEngine(name, name, 10000); diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs old mode 100644 new mode 100755 index 40b83f3ab8..3baf03d2c6 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs @@ -219,7 +219,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement // instead drop the request entirely. if(!client.IsActive) return; - if (GetUser(uuid, out user)) + if (GetUser(uuid, client.ScopeId, out user)) { if(client.IsActive) client.SendNameReply(uuid, user.FirstName, user.LastName); @@ -716,7 +716,12 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement #region Cache Management public virtual bool GetUser(UUID uuid, out UserData userdata) { - if(m_Scenes.Count <= 0) + return GetUser(uuid, m_Scenes[0].RegionInfo.ScopeID, out userdata); + } + + public virtual bool GetUser(UUID uuid, UUID scopeID, out UserData userdata) + { + if (m_Scenes.Count <= 0) { userdata = new UserData(); return false; @@ -749,7 +754,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement if (!userdata.HasGridUserTried) { /* rewrite here */ - UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, uuid); + UserAccount account = m_Scenes[0].UserAccountService.GetUserAccount(scopeID, uuid); if (account != null) { userdata.FirstName = account.FirstName; diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs old mode 100644 new mode 100755 index e27bbc3f74..002bfad77d --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -542,6 +542,8 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server get { return m_agentID; } } + public UUID ScopeId { get { return UUID.Zero; } } + public void Disconnect(string reason) { IRC_SendChannelPrivmsg("System", "You have been eaten by a grue. (" + reason + ")"); diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs old mode 100644 new mode 100755 index d3eb25f671..798576cd3f --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -67,6 +67,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC private readonly Vector3 m_startPos; private UUID m_uuid = UUID.Random(); private readonly Scene m_scene; + private readonly UUID m_scopeID; private readonly UUID m_ownerID; private UUID m_hostGroupID; private string m_profileAbout = ""; @@ -82,6 +83,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC m_startPos = position; m_uuid = UUID.Random(); m_scene = scene; + m_scopeID = scene.RegionInfo.ScopeID; m_ownerID = ownerID; SenseAsAgent = senseAsAgent; m_hostGroupID = UUID.Zero; @@ -123,6 +125,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC get { return m_scene; } } + public UUID ScopeId + { + get { return m_scopeID; } + } + public int PingTimeMS { get { return 0; } } public UUID OwnerID diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs old mode 100644 new mode 100755 index fd14291241..6cea71f0fc --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -453,6 +453,11 @@ namespace OpenSim.Tests.Common get { return m_scene; } } + public UUID ScopeId + { + get { return UUID.Zero; } + } + public bool SendLogoutPacketWhenClosing { set { }