mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs OpenSim/Services/Connectors/Neighbour/NeighbourServicesConnector.cs
This commit is contained in:
@@ -361,22 +361,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
|
||||
// If we're an NPC then skip all the item checks and manipulations since we don't have an
|
||||
// inventory right now.
|
||||
SceneObjectGroup objatt
|
||||
= RezSingleAttachmentFromInventoryInternal(
|
||||
RezSingleAttachmentFromInventoryInternal(
|
||||
sp, sp.PresenceType == PresenceType.Npc ? UUID.Zero : attach.ItemID, attach.AssetID, attachmentPt, true, d);
|
||||
|
||||
|
||||
if (ThrottlePer100PrimsRezzed > 0)
|
||||
{
|
||||
int throttleMs = (int)Math.Round((float)objatt.PrimCount / 100 * ThrottlePer100PrimsRezzed);
|
||||
|
||||
if (DebugLevel > 0)
|
||||
m_log.DebugFormat(
|
||||
"[ATTACHMENTS MODULE]: Throttling by {0}ms after rez of {1} with {2} prims for attachment to {3} on point {4} in {5}",
|
||||
throttleMs, objatt.Name, objatt.PrimCount, sp.Name, attachmentPt, m_scene.Name);
|
||||
|
||||
Thread.Sleep(throttleMs);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
||||
@@ -844,7 +844,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
AgentCircuitData acd = SceneHelpers.GenerateAgentData(ua1.PrincipalID);
|
||||
TestClient tc = new TestClient(acd, sceneA);
|
||||
List<TestClient> destinationTestClients = new List<TestClient>();
|
||||
EntityTransferHelpers.SetUpInformClientOfNeighbour(tc, destinationTestClients);
|
||||
EntityTransferHelpers.SetupInformClientOfNeighbourTriggersNeighbourClientCreate(tc, destinationTestClients);
|
||||
|
||||
ScenePresence beforeTeleportSp = SceneHelpers.AddScenePresence(sceneA, tc, acd);
|
||||
beforeTeleportSp.AbsolutePosition = new Vector3(30, 31, 32);
|
||||
@@ -925,7 +925,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
IConfig modulesConfig = config.AddConfig("Modules");
|
||||
modulesConfig.Set("EntityTransferModule", etmA.Name);
|
||||
modulesConfig.Set("SimulationServices", lscm.Name);
|
||||
IConfig entityTransferConfig = config.AddConfig("EntityTransfer");
|
||||
|
||||
modulesConfig.Set("InventoryAccessModule", "BasicInventoryAccessModule");
|
||||
|
||||
@@ -944,7 +943,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
AgentCircuitData acd = SceneHelpers.GenerateAgentData(ua1.PrincipalID);
|
||||
TestClient tc = new TestClient(acd, sceneA);
|
||||
List<TestClient> destinationTestClients = new List<TestClient>();
|
||||
EntityTransferHelpers.SetUpInformClientOfNeighbour(tc, destinationTestClients);
|
||||
EntityTransferHelpers.SetupInformClientOfNeighbourTriggersNeighbourClientCreate(tc, destinationTestClients);
|
||||
|
||||
ScenePresence beforeTeleportSp = SceneHelpers.AddScenePresence(sceneA, tc, acd);
|
||||
beforeTeleportSp.AbsolutePosition = new Vector3(30, 31, 32);
|
||||
@@ -966,7 +965,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
// Both these operations will occur on different threads and will wait for each other.
|
||||
// We have to do this via ThreadPool directly since FireAndForget has been switched to sync for the V1
|
||||
// test protocol, where we are trying to avoid unpredictable async operations in regression tests.
|
||||
((TestClient)beforeTeleportSp.ControllingClient).OnTestClientSendRegionTeleport
|
||||
tc.OnTestClientSendRegionTeleport
|
||||
+= (regionHandle, simAccess, regionExternalEndPoint, locationID, flags, capsURL)
|
||||
=> ThreadPool.UnsafeQueueUserWorkItem(o => destinationTestClients[0].CompleteMovement(), null);
|
||||
|
||||
|
||||
@@ -307,7 +307,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||
}
|
||||
|
||||
string serverURI = string.Empty;
|
||||
bool foreign = GetUserProfileServerURI(targetID, out serverURI);
|
||||
GetUserProfileServerURI(targetID, out serverURI);
|
||||
UUID creatorId = UUID.Zero;
|
||||
|
||||
OSDMap parameters= new OSDMap();
|
||||
@@ -372,7 +372,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||
}
|
||||
|
||||
string serverURI = string.Empty;
|
||||
bool foreign = GetUserProfileServerURI(target, out serverURI);
|
||||
GetUserProfileServerURI(target, out serverURI);
|
||||
|
||||
object Ad = (object)ad;
|
||||
if(!JsonRpcRequest(ref Ad, "classifieds_info_query", serverURI, UUID.Random().ToString()))
|
||||
@@ -441,10 +441,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||
Vector3 pos = remoteClient.SceneAgent.AbsolutePosition;
|
||||
ILandObject land = s.LandChannel.GetLandObject(pos.X, pos.Y);
|
||||
ScenePresence p = FindPresence(remoteClient.AgentId);
|
||||
Vector3 avaPos = p.AbsolutePosition;
|
||||
// Vector3 avaPos = p.AbsolutePosition;
|
||||
|
||||
string serverURI = string.Empty;
|
||||
bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
|
||||
GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
|
||||
|
||||
if (land == null)
|
||||
{
|
||||
@@ -470,7 +470,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||
|
||||
object Ad = ad;
|
||||
|
||||
OSD X = OSD.SerializeMembers(Ad);
|
||||
OSD.SerializeMembers(Ad);
|
||||
|
||||
if(!JsonRpcRequest(ref Ad, "classified_update", serverURI, UUID.Random().ToString()))
|
||||
{
|
||||
@@ -491,7 +491,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||
public void ClassifiedDelete(UUID queryClassifiedID, IClientAPI remoteClient)
|
||||
{
|
||||
string serverURI = string.Empty;
|
||||
bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
|
||||
GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
|
||||
|
||||
UUID classifiedId;
|
||||
OSDMap parameters= new OSDMap();
|
||||
@@ -541,7 +541,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||
}
|
||||
|
||||
string serverURI = string.Empty;
|
||||
bool foreign = GetUserProfileServerURI(targetId, out serverURI);
|
||||
GetUserProfileServerURI(targetId, out serverURI);
|
||||
|
||||
OSDMap parameters= new OSDMap();
|
||||
parameters.Add("creatorId", OSD.FromUUID(targetId));
|
||||
@@ -592,7 +592,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||
UUID targetID;
|
||||
UUID.TryParse(args[0], out targetID);
|
||||
string serverURI = string.Empty;
|
||||
bool foreign = GetUserProfileServerURI(targetID, out serverURI);
|
||||
GetUserProfileServerURI(targetID, out serverURI);
|
||||
IClientAPI remoteClient = (IClientAPI)sender;
|
||||
|
||||
UserProfilePick pick = new UserProfilePick();
|
||||
@@ -660,7 +660,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||
m_log.DebugFormat("[PROFILES]: Start PickInfoUpdate Name: {0} PickId: {1} SnapshotId: {2}", name, pickID.ToString(), snapshotID.ToString());
|
||||
UserProfilePick pick = new UserProfilePick();
|
||||
string serverURI = string.Empty;
|
||||
bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
|
||||
GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
|
||||
ScenePresence p = FindPresence(remoteClient.AgentId);
|
||||
|
||||
Vector3 avaPos = p.AbsolutePosition;
|
||||
@@ -720,7 +720,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||
public void PickDelete(IClientAPI remoteClient, UUID queryPickID)
|
||||
{
|
||||
string serverURI = string.Empty;
|
||||
bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
|
||||
GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
|
||||
|
||||
OSDMap parameters= new OSDMap();
|
||||
parameters.Add("pickId", OSD.FromUUID(queryPickID));
|
||||
@@ -755,7 +755,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||
|
||||
IClientAPI remoteClient = (IClientAPI)sender;
|
||||
string serverURI = string.Empty;
|
||||
bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
|
||||
GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
|
||||
note.TargetId = remoteClient.AgentId;
|
||||
UUID.TryParse(args[0], out note.UserId);
|
||||
|
||||
@@ -791,7 +791,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||
note.Notes = queryNotes;
|
||||
|
||||
string serverURI = string.Empty;
|
||||
bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
|
||||
GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
|
||||
|
||||
object Note = note;
|
||||
if(!JsonRpcRequest(ref Note, "avatar_notes_update", serverURI, UUID.Random().ToString()))
|
||||
@@ -836,7 +836,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||
prop.Language = languages;
|
||||
|
||||
string serverURI = string.Empty;
|
||||
bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
|
||||
GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
|
||||
|
||||
object Param = prop;
|
||||
if(!JsonRpcRequest(ref Param, "avatar_interests_update", serverURI, UUID.Random().ToString()))
|
||||
@@ -958,7 +958,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||
prop.FirstLifeText = newProfile.FirstLifeAboutText;
|
||||
|
||||
string serverURI = string.Empty;
|
||||
bool foreign = GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
|
||||
GetUserProfileServerURI(remoteClient.AgentId, out serverURI);
|
||||
|
||||
object Prop = prop;
|
||||
|
||||
@@ -972,7 +972,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the profile data.
|
||||
/// </summary>
|
||||
@@ -997,7 +996,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||
}
|
||||
|
||||
string serverURI = string.Empty;
|
||||
bool foreign = GetUserProfileServerURI(properties.UserId, out serverURI);
|
||||
GetUserProfileServerURI(properties.UserId, out serverURI);
|
||||
|
||||
// This is checking a friend on the home grid
|
||||
// Not HG friend
|
||||
@@ -1245,11 +1244,10 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||
return false;
|
||||
}
|
||||
|
||||
byte[] buf = new byte[8192];
|
||||
Stream rstream = webResponse.GetResponseStream();
|
||||
OSDMap mret = (OSDMap)OSDParser.DeserializeJson(rstream);
|
||||
|
||||
if(mret.ContainsKey("error"))
|
||||
if (mret.ContainsKey("error"))
|
||||
return false;
|
||||
|
||||
// get params...
|
||||
@@ -1311,7 +1309,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.UserProfiles
|
||||
return false;
|
||||
}
|
||||
|
||||
byte[] buf = new byte[8192];
|
||||
Stream rstream = webResponse.GetResponseStream();
|
||||
|
||||
OSDMap response = new OSDMap();
|
||||
|
||||
@@ -317,7 +317,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
"[ENTITY TRANSFER MODULE]: Ignoring teleport request of {0} {1} to {2}@{3} - agent is already in transit.",
|
||||
sp.Name, sp.UUID, position, regionHandle);
|
||||
|
||||
sp.ControllingClient.SendTeleportFailed("Slow down!");
|
||||
sp.ControllingClient.SendTeleportFailed("Previous teleport process incomplete. Please retry shortly.");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1034,6 +1035,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
agent.SenderWantsToWaitForRoot = true;
|
||||
//SetCallbackURL(agent, sp.Scene.RegionInfo);
|
||||
|
||||
// Reset the do not close flag. This must be done before the destination opens child connections (here
|
||||
// triggered by UpdateAgent) to avoid race conditions. However, we also want to reset it as late as possible
|
||||
// to avoid a situation where an unexpectedly early call to Scene.NewUserConnection() wrongly results
|
||||
// in no close.
|
||||
sp.DoNotCloseAfterTeleport = false;
|
||||
|
||||
// Send the Update. If this returns true, we know the client has contacted the destination
|
||||
// via CompleteMovementIntoRegion, so we can let go.
|
||||
// If it returns false, something went wrong, and we need to abort.
|
||||
@@ -1060,6 +1067,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp);
|
||||
|
||||
// Need to signal neighbours whether child agents may need closing irrespective of whether this
|
||||
// one needed closing. We also need to close child agents as quickly as possible to avoid complicated
|
||||
// race conditions with rapid agent releporting (e.g. from A1 to a non-neighbour B, back
|
||||
// to a neighbour A2 then off to a non-neighbour C). Closing child agents any later requires complex
|
||||
// distributed checks to avoid problems in rapid reteleporting scenarios and where child agents are
|
||||
// abandoned without proper close by viewer but then re-used by an incoming connection.
|
||||
sp.CloseChildAgents(newRegionX, newRegionY);
|
||||
|
||||
// May need to logout or other cleanup
|
||||
AgentHasMovedAway(sp, logout);
|
||||
|
||||
@@ -1069,22 +1084,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
// Now let's make it officially a child agent
|
||||
sp.MakeChildAgent();
|
||||
|
||||
// May still need to signal neighbours whether child agents may need closing irrespective of whether this
|
||||
// one needed closing. Neighbour regions also contain logic to prevent a close if a subsequent move or
|
||||
// teleport re-established the child connection.
|
||||
//
|
||||
// It may be possible to also close child agents after a pause but one needs to be very careful about
|
||||
// race conditions between different regions on rapid teleporting (e.g. from A1 to a non-neighbour B, back
|
||||
// to a neighbour A2 then off to a non-neighbour C. Also, closing child agents early may be more compatible
|
||||
// with complicated scenarios where there a mixture of V1 and V2 teleports, though this is conjecture. It's
|
||||
// easier to close immediately and greatly reduce the scope of race conditions if possible.
|
||||
sp.CloseChildAgents(newRegionX, newRegionY);
|
||||
|
||||
// Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
|
||||
if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
|
||||
{
|
||||
sp.DoNotCloseAfterTeleport = false;
|
||||
|
||||
// RED ALERT!!!!
|
||||
// PLEASE DO NOT DECREASE THIS WAIT TIME UNDER ANY CIRCUMSTANCES.
|
||||
// THE VIEWERS SEEM TO NEED SOME TIME AFTER RECEIVING MoveAgentIntoRegion
|
||||
@@ -1093,17 +1095,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
// IN THE AVIE BEING PLACED IN INFINITY FOR A COUPLE OF SECONDS.
|
||||
Thread.Sleep(15000);
|
||||
|
||||
if (!sp.DoNotCloseAfterTeleport)
|
||||
{
|
||||
// OK, it got this agent. Let's close everything
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Closing agent {0} in {1}", sp.Name, Scene.Name);
|
||||
sp.Scene.IncomingCloseAgent(sp.UUID, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Not closing agent {0}, user is back in {1}", sp.Name, Scene.Name);
|
||||
sp.DoNotCloseAfterTeleport = false;
|
||||
}
|
||||
// OK, it got this agent. Let's close everything
|
||||
// If we shouldn't close the agent due to some other region renewing the connection
|
||||
// then this will be handled in IncomingCloseAgent under lock conditions
|
||||
m_log.DebugFormat(
|
||||
"[ENTITY TRANSFER MODULE]: Closing agent {0} in {1} after teleport", sp.Name, Scene.Name);
|
||||
sp.Scene.IncomingCloseAgent(sp.UUID, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user