HG Landmarks bug fix: pull landmark asset data from user's asset server when user is traveling.

bulletsim
Diva Canto 2011-06-03 11:33:44 -07:00
parent fde3e704d3
commit 623706d988
1 changed files with 24 additions and 4 deletions

View File

@ -8308,11 +8308,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP
if (lma == null) if (lma == null)
{ {
// Failed to find landmark // Failed to find landmark
// Let's try to search in the user's home asset server
lma = FindAssetInUserAssetServer(lmid.ToString());
if (lma == null)
{
// Really doesn't exist
TeleportCancelPacket tpCancel = (TeleportCancelPacket)PacketPool.Instance.GetPacket(PacketType.TeleportCancel); TeleportCancelPacket tpCancel = (TeleportCancelPacket)PacketPool.Instance.GetPacket(PacketType.TeleportCancel);
tpCancel.Info.SessionID = tpReq.Info.SessionID; tpCancel.Info.SessionID = tpReq.Info.SessionID;
tpCancel.Info.AgentID = tpReq.Info.AgentID; tpCancel.Info.AgentID = tpReq.Info.AgentID;
OutPacket(tpCancel, ThrottleOutPacketType.Task); OutPacket(tpCancel, ThrottleOutPacketType.Task);
} }
}
try try
{ {
@ -8356,6 +8364,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
return true; return true;
} }
private AssetBase FindAssetInUserAssetServer(string id)
{
AgentCircuitData aCircuit = ((Scene)Scene).AuthenticateHandler.GetAgentCircuitData(CircuitCode);
if (aCircuit != null && aCircuit.ServiceURLs != null && aCircuit.ServiceURLs.ContainsKey("AssetServerURI"))
{
string assetServer = aCircuit.ServiceURLs["AssetServerURI"].ToString();
return ((Scene)Scene).AssetService.Get(assetServer + "/" + id);
}
return null;
}
private bool HandleTeleportLocationRequest(IClientAPI sender, Packet Pack) private bool HandleTeleportLocationRequest(IClientAPI sender, Packet Pack)
{ {
TeleportLocationRequestPacket tpLocReq = (TeleportLocationRequestPacket)Pack; TeleportLocationRequestPacket tpLocReq = (TeleportLocationRequestPacket)Pack;