mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 17:05:55 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
This commit is contained in:
@@ -573,8 +573,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
|
||||
}
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[ATTACHMENTS MODULE]: Detaching object {0} {1} for {2} in {3}",
|
||||
// so.Name, so.LocalId, sp.Name, m_scene.Name);
|
||||
// "[ATTACHMENTS MODULE]: Detaching object {0} {1} (FromItemID {2}) for {3} in {4}",
|
||||
// so.Name, so.LocalId, so.FromItemID, sp.Name, m_scene.Name);
|
||||
|
||||
// Scripts MUST be snapshotted before the object is
|
||||
// removed from the scene because doing otherwise will
|
||||
|
||||
@@ -829,7 +829,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
sceneB, config, new CapabilitiesModule(), etmB, attModB, new BasicInventoryAccessModule());
|
||||
|
||||
UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(sceneA, 0x1);
|
||||
ScenePresence beforeTeleportSp = SceneHelpers.AddScenePresence(sceneA, ua1.PrincipalID, sh.SceneManager);
|
||||
|
||||
AgentCircuitData acd = SceneHelpers.GenerateAgentData(ua1.PrincipalID);
|
||||
TestClient tc = new TestClient(acd, sceneA, sh.SceneManager);
|
||||
List<TestClient> destinationTestClients = new List<TestClient>();
|
||||
EntityTransferHelpers.SetUpInformClientOfNeighbour(tc, destinationTestClients);
|
||||
|
||||
ScenePresence beforeTeleportSp = SceneHelpers.AddScenePresence(sceneA, tc, acd, sh.SceneManager);
|
||||
beforeTeleportSp.AbsolutePosition = new Vector3(30, 31, 32);
|
||||
|
||||
InventoryItemBase attItem = CreateAttachmentItem(sceneA, ua1.PrincipalID, "att", 0x10, 0x20);
|
||||
@@ -848,7 +854,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
|
||||
teleportLookAt,
|
||||
(uint)TeleportFlags.ViaLocation);
|
||||
|
||||
((TestClient)beforeTeleportSp.ControllingClient).CompleteTeleportClientSide();
|
||||
destinationTestClients[0].CompleteMovement();
|
||||
|
||||
// Check attachments have made it into sceneB
|
||||
ScenePresence afterTeleportSceneBSp = sceneB.GetScenePresence(ua1.PrincipalID);
|
||||
|
||||
@@ -361,7 +361,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
|
||||
public void QueueAppearanceSave(UUID agentid)
|
||||
{
|
||||
// m_log.WarnFormat("[AVFACTORY]: Queue appearance save for {0}", agentid);
|
||||
// m_log.DebugFormat("[AVFACTORY]: Queueing appearance save for {0}", agentid);
|
||||
|
||||
// 10000 ticks per millisecond, 1000 milliseconds per second
|
||||
long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_savetime * 1000 * 10000);
|
||||
@@ -658,7 +658,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
return;
|
||||
}
|
||||
|
||||
// m_log.WarnFormat("[AVFACTORY] avatar {0} save appearance",agentid);
|
||||
// m_log.DebugFormat("[AVFACTORY]: Saving appearance for avatar {0}", agentid);
|
||||
|
||||
// This could take awhile since it needs to pull inventory
|
||||
// We need to do it at the point of save so that there is a sufficient delay for any upload of new body part/shape
|
||||
@@ -667,6 +667,14 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
// multiple save requests.
|
||||
SetAppearanceAssets(sp.UUID, sp.Appearance);
|
||||
|
||||
// List<AvatarAttachment> attachments = sp.Appearance.GetAttachments();
|
||||
// foreach (AvatarAttachment att in attachments)
|
||||
// {
|
||||
// m_log.DebugFormat(
|
||||
// "[AVFACTORY]: For {0} saving attachment {1} at point {2}",
|
||||
// sp.Name, att.ItemID, att.AttachPoint);
|
||||
// }
|
||||
|
||||
m_scene.AvatarService.SetAppearance(agentid, sp.Appearance);
|
||||
|
||||
// Trigger this here because it's the final step in the set/queue/save process for appearance setting.
|
||||
|
||||
@@ -256,7 +256,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
|
||||
// If camera is moved into client, then camera position can be used
|
||||
// MT: No, it can't, as chat is heard from the avatar position, not
|
||||
// the camera position.
|
||||
s.ForEachRootScenePresence(
|
||||
s.ForEachScenePresence(
|
||||
delegate(ScenePresence presence)
|
||||
{
|
||||
if (destination != UUID.Zero && presence.UUID != destination)
|
||||
|
||||
@@ -520,12 +520,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
"[ENTITY TRANSFER MODULE]: Failed validation of all attachments for teleport of {0} from {1} to {2}. Continuing.",
|
||||
sp.Name, sp.Scene.RegionInfo.RegionName, finalDestination.RegionName);
|
||||
|
||||
// if (!sp.ValidateAttachments())
|
||||
// {
|
||||
// sp.ControllingClient.SendTeleportFailed("Inconsistent attachment state");
|
||||
// return;
|
||||
// }
|
||||
|
||||
string reason;
|
||||
string version;
|
||||
if (!Scene.SimulationService.QueryAccess(
|
||||
@@ -588,6 +582,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
}
|
||||
|
||||
// Let's create an agent there if one doesn't exist yet.
|
||||
// NOTE: logout will always be false for a non-HG teleport.
|
||||
bool logout = false;
|
||||
if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout))
|
||||
{
|
||||
@@ -630,11 +625,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
if (m_eqModule != null)
|
||||
{
|
||||
// The EnableSimulator message makes the client establish a connection with the destination
|
||||
// simulator by sending the initial UseCircuitCode UDP packet to the destination containing the
|
||||
// correct circuit code.
|
||||
m_eqModule.EnableSimulator(destinationHandle, endPoint, sp.UUID);
|
||||
|
||||
// ES makes the client send a UseCircuitCode message to the destination,
|
||||
// which triggers a bunch of things there.
|
||||
// So let's wait
|
||||
// XXX: Is this wait necessary? We will always end up waiting on UpdateAgent for the destination
|
||||
// simulator to confirm that it has established communication with the viewer.
|
||||
Thread.Sleep(200);
|
||||
|
||||
// At least on LL 3.3.4 for teleports between different regions on the same simulator this appears
|
||||
@@ -645,6 +642,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
}
|
||||
else
|
||||
{
|
||||
// XXX: This is a little misleading since we're information the client of its avatar destination,
|
||||
// which may or may not be a neighbour region of the source region. This path is probably little
|
||||
// used anyway (with EQ being the one used). But it is currently being used for test code.
|
||||
sp.ControllingClient.InformClientOfNeighbour(destinationHandle, endPoint);
|
||||
}
|
||||
}
|
||||
@@ -662,14 +662,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
//sp.ControllingClient.SendTeleportProgress(teleportFlags, "Updating agent...");
|
||||
|
||||
// A common teleport failure occurs when we can send CreateAgent to the
|
||||
// destination region but the viewer cannot establish the connection (e.g. due to network issues between
|
||||
// the viewer and the destination). In this case, UpdateAgent timesout after 10 seconds, although then
|
||||
// there's a further 10 second wait whilst we attempt to tell the destination to delete the agent in Fail().
|
||||
if (!UpdateAgent(reg, finalDestination, agent, sp))
|
||||
{
|
||||
// Region doesn't take it
|
||||
m_log.WarnFormat(
|
||||
"[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1} from {2}. Returning avatar to source region.",
|
||||
"[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);
|
||||
Fail(sp, finalDestination, logout, "Connection between viewer and destination region could not be established.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -688,6 +691,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
"[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} from {1} to {2}",
|
||||
capsPath, sp.Scene.RegionInfo.RegionName, sp.Name);
|
||||
|
||||
// We need to set this here to avoid an unlikely race condition when teleporting to a neighbour simulator,
|
||||
// where that neighbour simulator could otherwise request a child agent create on the source which then
|
||||
// closes our existing agent which is still signalled as root.
|
||||
sp.IsChildAgent = true;
|
||||
|
||||
if (m_eqModule != null)
|
||||
{
|
||||
m_eqModule.TeleportFinishEvent(destinationHandle, 13, endPoint, 0, teleportFlags, capsPath, sp.UUID);
|
||||
@@ -698,9 +706,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
teleportFlags, capsPath);
|
||||
}
|
||||
|
||||
// Let's set this to true tentatively. This does not trigger OnChildAgent
|
||||
sp.IsChildAgent = true;
|
||||
|
||||
// TeleportFinish makes the client send CompleteMovementIntoRegion (at the destination), which
|
||||
// trigers a whole shebang of things there, including MakeRoot. So let's wait for confirmation
|
||||
// that the client contacted the destination before we close things here.
|
||||
@@ -710,7 +715,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);
|
||||
Fail(sp, finalDestination, logout, "Destination region did not signal teleport completion.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -733,8 +738,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
// Now let's make it officially a child agent
|
||||
sp.MakeChildAgent();
|
||||
|
||||
// sp.Scene.CleanDroppedAttachments();
|
||||
|
||||
// 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))
|
||||
@@ -793,12 +796,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
/// <param name='sp'></param>
|
||||
/// <param name='finalDestination'></param>
|
||||
/// <param name='logout'></param>
|
||||
protected virtual void Fail(ScenePresence sp, GridRegion finalDestination, bool logout)
|
||||
/// <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)
|
||||
{
|
||||
CleanupAbortedInterRegionTeleport(sp, finalDestination);
|
||||
|
||||
sp.ControllingClient.SendTeleportFailed(
|
||||
string.Format("Problems connecting to destination {0}", finalDestination.RegionName));
|
||||
string.Format(
|
||||
"Problems connecting to destination {0}, reason: {1}", finalDestination.RegionName, reason));
|
||||
|
||||
sp.Scene.EventManager.TriggerTeleportFail(sp.ControllingClient, logout);
|
||||
}
|
||||
|
||||
|
||||
@@ -292,8 +292,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
|
||||
// There should be no race condition here since no other code should be removing the agent transfer or
|
||||
// changing the state to another other than Transferring => ReceivedAtDestination.
|
||||
while (m_agentsInTransit[id] != AgentTransferState.ReceivedAtDestination && count-- > 0)
|
||||
|
||||
while (count-- > 0)
|
||||
{
|
||||
lock (m_agentsInTransit)
|
||||
{
|
||||
if (m_agentsInTransit[id] == AgentTransferState.ReceivedAtDestination)
|
||||
break;
|
||||
}
|
||||
|
||||
// m_log.Debug(" >>> Waiting... " + count);
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace OpenSim.Region.CoreModules.Framework.Statistics.Logging
|
||||
{
|
||||
lock (m_logFileWriteLock)
|
||||
{
|
||||
DateTime now = DateTime.Now;
|
||||
DateTime now = DateTime.UtcNow;
|
||||
if (m_logFile == null || now > m_logFileEndTime)
|
||||
{
|
||||
if (m_logFile != null)
|
||||
|
||||
Reference in New Issue
Block a user