mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 03:06:05 +08:00
Guard against unauthorized agent deletes.
This commit is contained in:
@@ -817,7 +817,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
"[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1} from {2}. Keeping avatar in source region.",
|
||||
sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName);
|
||||
|
||||
Fail(sp, finalDestination, logout, "Connection between viewer and destination region could not be established.");
|
||||
Fail(sp, finalDestination, logout, Util.Md5Hash(currentAgentCircuit.Id0), "Connection between viewer and destination region could not be established.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -829,7 +829,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
"[ENTITY TRANSFER MODULE]: Cancelled teleport of {0} to {1} from {2} after UpdateAgent on client request",
|
||||
sp.Name, finalDestination.RegionName, sp.Scene.Name);
|
||||
|
||||
CleanupFailedInterRegionTeleport(sp, finalDestination);
|
||||
CleanupFailedInterRegionTeleport(sp, Util.Md5Hash(currentAgentCircuit.Id0), finalDestination);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -873,7 +873,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
"[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} from {2} failed due to no callback from destination region. Returning avatar to source region.",
|
||||
sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName);
|
||||
|
||||
Fail(sp, finalDestination, logout, "Destination region did not signal teleport completion.");
|
||||
Fail(sp, finalDestination, logout, Util.Md5Hash(currentAgentCircuit.Id0), "Destination region did not signal teleport completion.");
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -927,7 +927,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
/// <remarks>
|
||||
/// <param name='sp'> </param>
|
||||
/// <param name='finalDestination'></param>
|
||||
protected virtual void CleanupFailedInterRegionTeleport(ScenePresence sp, GridRegion finalDestination)
|
||||
protected virtual void CleanupFailedInterRegionTeleport(ScenePresence sp, string auth_token, GridRegion finalDestination)
|
||||
{
|
||||
m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp);
|
||||
|
||||
@@ -938,7 +938,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
// Finally, kill the agent we just created at the destination.
|
||||
// XXX: Possibly this should be done asynchronously.
|
||||
Scene.SimulationService.CloseAgent(finalDestination, sp.UUID);
|
||||
Scene.SimulationService.CloseAgent(finalDestination, sp.UUID, auth_token);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -948,9 +948,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
/// <param name='finalDestination'></param>
|
||||
/// <param name='logout'></param>
|
||||
/// <param name='reason'>Human readable reason for teleport failure. Will be sent to client.</param>
|
||||
protected virtual void Fail(ScenePresence sp, GridRegion finalDestination, bool logout, string reason)
|
||||
protected virtual void Fail(ScenePresence sp, GridRegion finalDestination, bool logout, string auth_code, string reason)
|
||||
{
|
||||
CleanupFailedInterRegionTeleport(sp, finalDestination);
|
||||
CleanupFailedInterRegionTeleport(sp, auth_code, finalDestination);
|
||||
|
||||
m_interRegionTeleportFailures.Value++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user