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 )

httptests
UbitUmarov 2017-06-09 23:27:33 +01:00
parent e8165a7b51
commit be975d1e89
6 changed files with 33 additions and 6 deletions

View File

@ -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<UUID,string> 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));

View File

@ -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)

View File

@ -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);

View File

@ -175,6 +175,7 @@ namespace OpenSim.Region.CoreModules.Framework.UserManagement
{
client.OnNameFromUUIDRequest -= new UUIDNameRequest(HandleUUIDNameRequest);
client.OnAvatarPickerRequest -= new AvatarPickerRequest(HandleAvatarPickerRequest);
client.OnConnectionClosed -= new Action<IClientAPI>(HandleConnectionClosed);
}
protected virtual void HandleUUIDNameRequest(UUID uuid, IClientAPI client)

View File

@ -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);

View File

@ -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; }
/// <summary>
@ -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)