From be975d1e89cbcb62f89cb7cb8367678a80cc47c6 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 9 Jun 2017 23:27:33 +0100 Subject: [PATCH] add a adicional in transit flag to signal HG tps, and use it to ignore usernames requests sent to start region during tp; don't send unknows display names ( getdisplaynames cap ) --- .../Linden/Caps/BunchOfCaps/BunchOfCaps.cs | 19 +++++++++++++++---- .../ClientStack/Linden/UDP/LLClientView.cs | 10 ++++++++-- .../EntityTransfer/EntityTransferModule.cs | 3 +++ .../UserManagement/UserManagementModule.cs | 1 + .../Framework/Scenes/SceneObjectGroup.cs | 1 + .../Region/Framework/Scenes/ScenePresence.cs | 5 +++++ 6 files changed, 33 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index e1b9e08f29..6f5775ad3d 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs @@ -1577,7 +1577,10 @@ namespace OpenSim.Region.ClientStack.Linden break; m_Scene.TryGetScenePresence(m_AgentID, out sp); - if(sp == null || sp.IsChildAgent || sp.IsDeleted || sp.IsInTransit) + if(sp == null || sp.IsChildAgent || sp.IsDeleted) + break; + + if(sp.IsInTransit && !sp.IsInLocalTransit) break; client = sp.ControllingClient; @@ -1699,7 +1702,10 @@ namespace OpenSim.Region.ClientStack.Linden break; m_Scene.TryGetScenePresence(m_AgentID, out sp); - if(sp == null || sp.IsChildAgent || sp.IsDeleted || sp.IsInTransit) + if(sp == null || sp.IsChildAgent || sp.IsDeleted) + break; + + if(sp.IsInTransit && !sp.IsInLocalTransit) break; client = sp.ControllingClient; @@ -1807,7 +1813,7 @@ namespace OpenSim.Region.ClientStack.Linden if(sp == null || sp.IsDeleted) return ""; - if(sp.IsInTransit) + if(sp.IsInTransit && !sp.IsInLocalTransit) { httpResponse.StatusCode = (int)System.Net.HttpStatusCode.ServiceUnavailable; httpResponse.AddHeader("Retry-After","30"); @@ -1817,7 +1823,6 @@ namespace OpenSim.Region.ClientStack.Linden NameValueCollection query = HttpUtility.ParseQueryString(httpRequest.Url.Query); string[] ids = query.GetValues("ids"); - Dictionary names = m_UserManager.GetUsersNames(ids); OSDMap osdReply = new OSDMap(); @@ -1833,12 +1838,18 @@ namespace OpenSim.Region.ClientStack.Linden string[] parts = kvp.Value.Split(new char[] {' '}); OSDMap osdname = new OSDMap(); + + // dont tell about unknown users, we can't send them back on Bad either + if(parts[0] == "Unknown") + continue; +/* if(parts[0] == "Unknown") { osdname["display_name_next_update"] = OSD.FromDate(DateTime.UtcNow.AddHours(1)); osdname["display_name_expires"] = OSD.FromDate(DateTime.UtcNow.AddHours(2)); } else +*/ { osdname["display_name_next_update"] = OSD.FromDate(DateTime.UtcNow.AddDays(8)); osdname["display_name_expires"] = OSD.FromDate(DateTime.UtcNow.AddMonths(1)); diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index f658a709af..1091078243 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -6473,8 +6473,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP private bool HandleUUIDGroupNameRequest(IClientAPI sender, Packet Pack) { - UUIDGroupNameRequestPacket upack = (UUIDGroupNameRequestPacket)Pack; + ScenePresence sp = (ScenePresence)SceneAgent; + if(sp == null || sp.IsDeleted || (sp.IsInTransit && !sp.IsInLocalTransit)) + return true; + UUIDGroupNameRequestPacket upack = (UUIDGroupNameRequestPacket)Pack; for (int i = 0; i < upack.UUIDNameBlock.Length; i++) { @@ -7493,7 +7496,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP SendUserInfoReply(false, true, ""); } return true; - } private bool HandleUpdateUserInfo(IClientAPI sender, Packet Pack) @@ -9648,6 +9650,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP private bool HandleUUIDNameRequest(IClientAPI sender, Packet Pack) { + ScenePresence sp = (ScenePresence)SceneAgent; + if(sp == null || sp.IsDeleted || (sp.IsInTransit && !sp.IsInLocalTransit)) + return true; + UUIDNameRequestPacket incoming = (UUIDNameRequestPacket)Pack; foreach (UUIDNameRequestPacket.UUIDNameBlockBlock UUIDBlock in incoming.UUIDNameBlock) diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 99bebdd061..c93c54d5cf 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -771,8 +771,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer else if (sp.Flying) teleportFlags |= (uint)TeleportFlags.IsFlying; + sp.IsInLocalTransit = finalDestination.RegionLocY != 0; // HG sp.IsInTransit = true; + if (DisableInterRegionTeleportCancellation) teleportFlags |= (uint)TeleportFlags.DisableCancel; @@ -1524,6 +1526,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer public bool Cross(ScenePresence agent, bool isFlying) { + agent.IsInLocalTransit = true; agent.IsInTransit = true; CrossAsyncDelegate d = CrossAsync; d.BeginInvoke(agent, isFlying, CrossCompleted, d); diff --git a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs index 32cb5a383a..269546430f 100644 --- a/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs +++ b/OpenSim/Region/CoreModules/Framework/UserManagement/UserManagementModule.cs @@ -175,6 +175,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement { client.OnNameFromUUIDRequest -= new UUIDNameRequest(HandleUUIDNameRequest); client.OnAvatarPickerRequest -= new AvatarPickerRequest(HandleAvatarPickerRequest); + client.OnConnectionClosed -= new Action(HandleConnectionClosed); } protected virtual void HandleUUIDNameRequest(UUID uuid, IClientAPI client) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 93c9b421aa..1695d9bd54 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -807,6 +807,7 @@ namespace OpenSim.Region.Framework.Scenes foreach (avtocrossInfo avinfo in avsToCross) { ScenePresence av = avinfo.av; + av.IsInLocalTransit = true; av.IsInTransit = true; m_log.DebugFormat("[SCENE OBJECT]: Crossing avatar {0} to {1}", av.Name, val); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index daa9e504ee..47af3b88cb 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -971,6 +971,10 @@ namespace OpenSim.Region.Framework.Scenes m_inTransit = value; } } + // this is is only valid if IsInTransit is true + // only false on HG tps + // used work arounf viewers asking source region about destination user + public bool IsInLocalTransit {get; set; } /// @@ -1040,6 +1044,7 @@ namespace OpenSim.Region.Framework.Scenes m_uuid = client.AgentId; LocalId = m_scene.AllocateLocalId(); LegacySitOffsets = m_scene.LegacySitOffsets; + IsInLocalTransit = true; UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid); if (account != null)