mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 02:36:00 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/Framework/Scenes/Scene.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
This commit is contained in:
@@ -371,11 +371,21 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
||||
if (missingTexturesOnly)
|
||||
{
|
||||
if (m_scene.AssetService.Get(face.TextureID.ToString()) != null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
// On inter-simulator teleports, this occurs if baked textures are not being stored by the
|
||||
// grid asset service (which means that they are not available to the new region and so have
|
||||
// to be re-requested from the client).
|
||||
//
|
||||
// The only available core OpenSimulator behaviour right now
|
||||
// is not to store these textures, temporarily or otherwise.
|
||||
m_log.DebugFormat(
|
||||
"[AVFACTORY]: Missing baked texture {0} ({1}) for {2}, requesting rebake.",
|
||||
face.TextureID, idx, sp.Name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -53,7 +53,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
public const int DefaultMaxTransferDistance = 4095;
|
||||
public const bool EnableWaitForCallbackFromTeleportDestDefault = true;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The maximum distance, in standard region units (256m) that an agent is allowed to transfer.
|
||||
/// </summary>
|
||||
@@ -211,6 +210,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
sp.Name, sp.AbsolutePosition, sp.Scene.RegionInfo.RegionName, position, destinationRegionName,
|
||||
e.Message, e.StackTrace);
|
||||
|
||||
// Make sure that we clear the in-transit flag so that future teleport attempts don't always fail.
|
||||
ResetFromTransit(sp.UUID);
|
||||
|
||||
sp.ControllingClient.SendTeleportFailed("Internal error");
|
||||
}
|
||||
}
|
||||
@@ -386,7 +388,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
return;
|
||||
}
|
||||
|
||||
if (IsInTransit(sp.UUID)) // Avie is already on the way. Caller shouldn't do this.
|
||||
if (!SetInTransit(sp.UUID)) // Avie is already on the way. Caller shouldn't do this.
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[ENTITY TRANSFER MODULE]: Ignoring teleport request of {0} {1} to {2} ({3}) {4}/{5} - agent is already in transit.",
|
||||
@@ -434,8 +436,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
if (!m_aScene.SimulationService.QueryAccess(finalDestination, sp.ControllingClient.AgentId, Vector3.Zero, out version, out reason))
|
||||
{
|
||||
sp.ControllingClient.SendTeleportFailed("Teleport failed: " + reason);
|
||||
ResetFromTransit(sp.UUID);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Destination is running version {0}", version);
|
||||
|
||||
sp.ControllingClient.SendTeleportStart(teleportFlags);
|
||||
@@ -475,13 +480,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
bool logout = false;
|
||||
if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout))
|
||||
{
|
||||
sp.ControllingClient.SendTeleportFailed(String.Format("Teleport refused: {0}",
|
||||
reason));
|
||||
sp.ControllingClient.SendTeleportFailed(
|
||||
String.Format("Teleport refused: {0}", reason));
|
||||
ResetFromTransit(sp.UUID);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// OK, it got this agent. Let's close some child agents
|
||||
sp.CloseChildAgents(newRegionX, newRegionY);
|
||||
|
||||
IClientIPEndpoint ipepClient;
|
||||
if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY))
|
||||
{
|
||||
@@ -518,8 +526,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
|
||||
}
|
||||
|
||||
SetInTransit(sp.UUID);
|
||||
|
||||
// Let's send a full update of the agent. This is a synchronous call.
|
||||
AgentData agent = new AgentData();
|
||||
sp.CopyTo(agent);
|
||||
@@ -532,8 +538,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
{
|
||||
// Region doesn't take it
|
||||
m_log.WarnFormat(
|
||||
"[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1}. Returning avatar to source region.",
|
||||
sp.Name, finalDestination.RegionName);
|
||||
"[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1} from {2}. Returning avatar to source region.",
|
||||
sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName);
|
||||
|
||||
Fail(sp, finalDestination, logout);
|
||||
return;
|
||||
@@ -565,8 +571,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
if (EnableWaitForCallbackFromTeleportDest && !WaitForCallback(sp.UUID))
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} failed due to no callback from destination region. Returning avatar to source region.",
|
||||
sp.Name, finalDestination.RegionName);
|
||||
"[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);
|
||||
return;
|
||||
@@ -662,8 +668,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
protected virtual void SetCallbackURL(AgentData agent, RegionInfo region)
|
||||
{
|
||||
agent.CallbackURI = region.ServerURI + "agent/" + agent.AgentID.ToString() + "/" + region.RegionID.ToString() + "/release/";
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Set callback URL to {0}", agent.CallbackURI);
|
||||
|
||||
m_log.DebugFormat(
|
||||
"[ENTITY TRANSFER MODULE]: Set release callback URL to {0} in {1}",
|
||||
agent.CallbackURI, region.RegionName);
|
||||
}
|
||||
|
||||
protected virtual void AgentHasMovedAway(ScenePresence sp, bool logout)
|
||||
@@ -1921,25 +1929,43 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
return count > 0;
|
||||
}
|
||||
|
||||
protected void SetInTransit(UUID id)
|
||||
/// <summary>
|
||||
/// Set that an agent is in the process of being teleported.
|
||||
/// </summary>
|
||||
/// <param name='id'>The ID of the agent being teleported</param>
|
||||
/// <returns>true if the agent was not already in transit, false if it was</returns>
|
||||
protected bool SetInTransit(UUID id)
|
||||
{
|
||||
lock (m_agentsInTransit)
|
||||
{
|
||||
if (!m_agentsInTransit.Contains(id))
|
||||
{
|
||||
m_agentsInTransit.Add(id);
|
||||
}
|
||||
}
|
||||
|
||||
protected bool IsInTransit(UUID id)
|
||||
{
|
||||
lock (m_agentsInTransit)
|
||||
{
|
||||
if (m_agentsInTransit.Contains(id))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Show whether the given agent is being teleported.
|
||||
/// </summary>
|
||||
/// <returns>true if the agent is in the process of being teleported, false otherwise.</returns>
|
||||
/// <param name='id'>The agent ID</para></param>
|
||||
protected bool IsInTransit(UUID id)
|
||||
{
|
||||
lock (m_agentsInTransit)
|
||||
return m_agentsInTransit.Contains(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set that an agent is no longer being teleported.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <param name='id'>
|
||||
/// true if the agent was flagged as being teleported when this method was called, false otherwise
|
||||
/// </param>
|
||||
protected bool ResetFromTransit(UUID id)
|
||||
{
|
||||
lock (m_agentsInTransit)
|
||||
@@ -1950,6 +1976,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1980,4 +2007,4 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -64,6 +64,8 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules
|
||||
private TimeSpan m_QueueTimeout = new TimeSpan(2, 0, 0); // 2 hours without llGetNextEmail drops the queue
|
||||
private string m_InterObjectHostname = "lsl.opensim.local";
|
||||
|
||||
private int m_MaxEmailSize = 4096; // largest email allowed by default, as per lsl docs.
|
||||
|
||||
// Scenes by Region Handle
|
||||
private Dictionary<ulong, Scene> m_Scenes =
|
||||
new Dictionary<ulong, Scene>();
|
||||
@@ -127,6 +129,7 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules
|
||||
SMTP_SERVER_PORT = SMTPConfig.GetInt("SMTP_SERVER_PORT", SMTP_SERVER_PORT);
|
||||
SMTP_SERVER_LOGIN = SMTPConfig.GetString("SMTP_SERVER_LOGIN", SMTP_SERVER_LOGIN);
|
||||
SMTP_SERVER_PASSWORD = SMTPConfig.GetString("SMTP_SERVER_PASSWORD", SMTP_SERVER_PASSWORD);
|
||||
m_MaxEmailSize = SMTPConfig.GetInt("email_max_size", m_MaxEmailSize);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -176,18 +179,6 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Delay function using thread in seconds
|
||||
/// </summary>
|
||||
/// <param name="seconds"></param>
|
||||
private void DelayInSeconds(int delay)
|
||||
{
|
||||
delay = (int)((float)delay * 1000);
|
||||
if (delay == 0)
|
||||
return;
|
||||
System.Threading.Thread.Sleep(delay);
|
||||
}
|
||||
|
||||
private bool IsLocal(UUID objectID)
|
||||
{
|
||||
string unused;
|
||||
@@ -267,10 +258,9 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules
|
||||
m_log.Error("[EMAIL] REGEX Problem in EMail Address: "+address);
|
||||
return;
|
||||
}
|
||||
//FIXME:Check if subject + body = 4096 Byte
|
||||
if ((subject.Length + body.Length) > 1024)
|
||||
if ((subject.Length + body.Length) > m_MaxEmailSize)
|
||||
{
|
||||
m_log.Error("[EMAIL] subject + body > 1024 Byte");
|
||||
m_log.Error("[EMAIL] subject + body larger than limit of " + m_MaxEmailSize + " bytes");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -345,10 +335,6 @@ namespace OpenSim.Region.CoreModules.Scripting.EmailModules
|
||||
// TODO FIX
|
||||
}
|
||||
}
|
||||
|
||||
//DONE: Message as Second Life style
|
||||
//20 second delay - AntiSpam System - for now only 10 seconds
|
||||
DelayInSeconds(10);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -245,6 +245,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
// Reload serialized prims
|
||||
m_log.InfoFormat("[ARCHIVER]: Loading {0} scene objects. Please wait.", serialisedSceneObjects.Count);
|
||||
|
||||
UUID oldTelehubUUID = m_scene.RegionInfo.RegionSettings.TelehubObject;
|
||||
|
||||
IRegionSerialiserModule serialiser = m_scene.RequestModuleInterface<IRegionSerialiserModule>();
|
||||
int sceneObjectsLoadedCount = 0;
|
||||
|
||||
@@ -266,11 +268,21 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
|
||||
SceneObjectGroup sceneObject = serialiser.DeserializeGroupFromXml2(serialisedSceneObject);
|
||||
|
||||
bool isTelehub = (sceneObject.UUID == oldTelehubUUID);
|
||||
|
||||
// For now, give all incoming scene objects new uuids. This will allow scenes to be cloned
|
||||
// on the same region server and multiple examples a single object archive to be imported
|
||||
// to the same scene (when this is possible).
|
||||
sceneObject.ResetIDs();
|
||||
|
||||
if (isTelehub)
|
||||
{
|
||||
// Change the Telehub Object to the new UUID
|
||||
m_scene.RegionInfo.RegionSettings.TelehubObject = sceneObject.UUID;
|
||||
m_scene.RegionInfo.RegionSettings.Save();
|
||||
oldTelehubUUID = UUID.Zero;
|
||||
}
|
||||
|
||||
// Try to retain the original creator/owner/lastowner if their uuid is present on this grid
|
||||
// or creator data is present. Otherwise, use the estate owner instead.
|
||||
foreach (SceneObjectPart part in sceneObject.Parts)
|
||||
@@ -347,7 +359,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
int ignoredObjects = serialisedSceneObjects.Count - sceneObjectsLoadedCount;
|
||||
|
||||
if (ignoredObjects > 0)
|
||||
m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects);
|
||||
m_log.WarnFormat("[ARCHIVER]: Ignored {0} scene objects that already existed in the scene", ignoredObjects);
|
||||
|
||||
if (oldTelehubUUID != UUID.Zero)
|
||||
{
|
||||
m_log.WarnFormat("Telehub object not found: {0}", oldTelehubUUID);
|
||||
m_scene.RegionInfo.RegionSettings.TelehubObject = UUID.Zero;
|
||||
m_scene.RegionInfo.RegionSettings.ClearSpawnPoints();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -523,6 +542,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
currentRegionSettings.TerrainTexture4 = loadedRegionSettings.TerrainTexture4;
|
||||
currentRegionSettings.UseEstateSun = loadedRegionSettings.UseEstateSun;
|
||||
currentRegionSettings.WaterHeight = loadedRegionSettings.WaterHeight;
|
||||
currentRegionSettings.TelehubObject = loadedRegionSettings.TelehubObject;
|
||||
currentRegionSettings.ClearSpawnPoints();
|
||||
foreach (SpawnPoint sp in loadedRegionSettings.SpawnPoints())
|
||||
currentRegionSettings.AddSpawnPoint(sp);
|
||||
|
||||
currentRegionSettings.Save();
|
||||
|
||||
|
||||
@@ -328,7 +328,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
|
||||
/// <returns></returns>
|
||||
public string CreateControlFile(Dictionary<string, object> options)
|
||||
{
|
||||
int majorVersion = MAX_MAJOR_VERSION, minorVersion = 7;
|
||||
int majorVersion = MAX_MAJOR_VERSION, minorVersion = 8;
|
||||
//
|
||||
// if (options.ContainsKey("version"))
|
||||
// {
|
||||
|
||||
@@ -534,6 +534,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
||||
rs.TerrainTexture4 = UUID.Parse("00000000-0000-0000-0000-000000000080");
|
||||
rs.UseEstateSun = true;
|
||||
rs.WaterHeight = 23;
|
||||
rs.TelehubObject = UUID.Parse("00000000-0000-0000-0000-111111111111");
|
||||
rs.AddSpawnPoint(SpawnPoint.Parse("1,-2,0.33"));
|
||||
|
||||
tar.WriteFile(ArchiveConstants.SETTINGS_PATH + "region1.xml", RegionSettingsSerializer.Serialize(rs));
|
||||
|
||||
@@ -580,6 +582,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests
|
||||
Assert.That(loadedRs.TerrainTexture4, Is.EqualTo(UUID.Parse("00000000-0000-0000-0000-000000000080")));
|
||||
Assert.That(loadedRs.UseEstateSun, Is.True);
|
||||
Assert.That(loadedRs.WaterHeight, Is.EqualTo(23));
|
||||
Assert.AreEqual(UUID.Zero, loadedRs.TelehubObject); // because no object was found with the original UUID
|
||||
Assert.AreEqual(0, loadedRs.SpawnPoints().Count);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user