Merge branch 'master' into careminster

Conflicts:
	OpenSim/Region/Application/OpenSimBase.cs
	OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
	OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs
	OpenSim/Region/Framework/Scenes/Scene.cs
	OpenSim/Region/Framework/Scenes/ScenePresence.cs
This commit is contained in:
Melanie
2013-08-11 17:31:25 +01:00
25 changed files with 871 additions and 364 deletions

View File

@@ -1069,8 +1069,18 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// Now let's make it officially a child agent
sp.MakeChildAgent();
// Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
// 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;
@@ -1086,14 +1096,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (!sp.DoNotCloseAfterTeleport)
{
// OK, it got this agent. Let's close everything
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Closing in agent {0} in region {1}", sp.Name, Scene.Name);
sp.CloseChildAgents(newRegionX, newRegionY);
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 {0}", sp.Name, Scene.Name);
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Not closing agent {0}, user is back in {1}", sp.Name, Scene.Name);
sp.DoNotCloseAfterTeleport = false;
}
}
@@ -1836,10 +1844,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
List<ulong> newRegions = NewNeighbours(neighbourHandles, previousRegionNeighbourHandles);
List<ulong> oldRegions = OldNeighbours(neighbourHandles, previousRegionNeighbourHandles);
//Dump("Current Neighbors", neighbourHandles);
//Dump("Previous Neighbours", previousRegionNeighbourHandles);
//Dump("New Neighbours", newRegions);
//Dump("Old Neighbours", oldRegions);
// Dump("Current Neighbors", neighbourHandles);
// Dump("Previous Neighbours", previousRegionNeighbourHandles);
// Dump("New Neighbours", newRegions);
// Dump("Old Neighbours", oldRegions);
/// Update the scene presence's known regions here on this region
sp.DropOldNeighbours(oldRegions);
@@ -1847,8 +1855,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
/// Collect as many seeds as possible
Dictionary<ulong, string> seeds;
if (sp.Scene.CapsModule != null)
seeds
= new Dictionary<ulong, string>(sp.Scene.CapsModule.GetChildrenSeeds(sp.UUID));
seeds = new Dictionary<ulong, string>(sp.Scene.CapsModule.GetChildrenSeeds(sp.UUID));
else
seeds = new Dictionary<ulong, string>();
@@ -1918,6 +1925,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
newAgent = true;
else
newAgent = false;
// continue;
if (neighbour.RegionHandle != sp.Scene.RegionInfo.RegionHandle)
{

View File

@@ -45,6 +45,7 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms
{
private static readonly ILog m_log =
LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private static string LogHeader = "[MODULE COMMS]";
private Dictionary<string,object> m_constants = new Dictionary<string,object>();
@@ -148,7 +149,7 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms
MethodInfo mi = GetMethodInfoFromType(target.GetType(), meth, true);
if (mi == null)
{
m_log.WarnFormat("[MODULE COMMANDS] Failed to register method {0}", meth);
m_log.WarnFormat("{0} Failed to register method {1}", LogHeader, meth);
return;
}
@@ -165,7 +166,7 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms
{
// m_log.DebugFormat("[MODULE COMMANDS] Register method {0} from type {1}", mi.Name, (target is Type) ? ((Type)target).Name : target.GetType().Name);
Type delegateType;
Type delegateType = typeof(void);
List<Type> typeArgs = mi.GetParameters()
.Select(p => p.ParameterType)
.ToList();
@@ -176,8 +177,16 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms
}
else
{
typeArgs.Add(mi.ReturnType);
delegateType = Expression.GetFuncType(typeArgs.ToArray());
try
{
typeArgs.Add(mi.ReturnType);
delegateType = Expression.GetFuncType(typeArgs.ToArray());
}
catch (Exception e)
{
m_log.ErrorFormat("{0} Failed to create function signature. Most likely more than 5 parameters. Method={1}. Error={2}",
LogHeader, mi.Name, e);
}
}
Delegate fcall;

View File

@@ -76,6 +76,13 @@ namespace OpenSim.Region.CoreModules.World.Estate
" that coordinate. Corner # SW = 0, NW = 1, SE = 2, NE = 3, all corners = -1.",
consoleSetTerrainHeights);
m_module.Scene.AddCommand("Regions", m_module, "set water height",
"set water height <height> [<x>] [<y>]",
"Sets the water height in meters. If <x> and <y> are specified, it will only set it on regions with a matching coordinate. " +
"Specify -1 in <x> or <y> to wildcard that coordinate.",
consoleSetWaterHeight);
m_module.Scene.AddCommand(
"Estates", m_module, "estate show", "estate show", "Shows all estates on the simulator.", ShowEstatesCommand);
}
@@ -121,7 +128,29 @@ namespace OpenSim.Region.CoreModules.World.Estate
}
}
}
protected void consoleSetWaterHeight(string module, string[] args)
{
string heightstring = args[3];
int x = (args.Length > 4 ? int.Parse(args[4]) : -1);
int y = (args.Length > 5 ? int.Parse(args[5]) : -1);
if (x == -1 || m_module.Scene.RegionInfo.RegionLocX == x)
{
if (y == -1 || m_module.Scene.RegionInfo.RegionLocY == y)
{
double selectedheight = double.Parse(heightstring);
m_log.Debug("[ESTATEMODULE]: Setting water height in " + m_module.Scene.RegionInfo.RegionName + " to " +
string.Format(" {0}", selectedheight));
m_module.Scene.RegionInfo.RegionSettings.WaterHeight = selectedheight;
m_module.Scene.RegionInfo.RegionSettings.Save();
m_module.TriggerRegionInfoChange();
m_module.sendRegionHandshakeToAll();
}
}
}
protected void consoleSetTerrainHeights(string module, string[] args)
{
string num = args[3];

View File

@@ -572,7 +572,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
if (!Scene.TeleportClientHome(user, s.ControllingClient))
{
s.ControllingClient.Kick("Your access to the region was revoked and TP home failed - you have been logged out.");
s.ControllingClient.Close();
Scene.IncomingCloseAgent(s.UUID, false);
}
}
}
@@ -807,7 +807,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
if (!Scene.TeleportClientHome(prey, s.ControllingClient))
{
s.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out.");
s.ControllingClient.Close();
Scene.IncomingCloseAgent(s.UUID, false);
}
}
}
@@ -830,7 +830,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
if (!Scene.TeleportClientHome(p.UUID, p.ControllingClient))
{
p.ControllingClient.Kick("You were teleported home by the region owner, but the TP failed - you have been logged out.");
p.ControllingClient.Close();
Scene.IncomingCloseAgent(p.UUID, false);
}
}
}