* Did some initial work for prim crossing. Just glue so far.

* Added the child_get_tasks OpenSim.ini flag for testing the UDP packet sending code and packet throttler.   This flag gets purposely disabled in grid mode.  This flag also has the consequence that you can see the prim in neighboring regions without going into them.  Be warned, this causes tons of dropped packets.
afrisby
Teravus Ovares 2007-11-21 02:17:24 +00:00
parent 7b09800d5b
commit 7cb38712d5
14 changed files with 370 additions and 11 deletions

View File

@ -32,8 +32,15 @@ namespace OpenSim.Framework.Communications
public interface IInterRegionCommunications public interface IInterRegionCommunications
{ {
bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData); bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData);
bool InformRegionOfPrimCrossing(ulong regionHandle, LLUUID primID, string objData);
bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying); bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying);
bool ExpectPrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, bool isFlying);
bool AcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentId); bool AcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentId);
bool AcknowledgePrimCrossed(ulong regionHandle, LLUUID primID);
void TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID); void TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID);
} }
} }

View File

@ -32,20 +32,31 @@ namespace OpenSim.Framework
{ {
public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent); public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent);
public delegate void ExpectPrimDelegate(ulong regionHandle, LLUUID primID, string objData);
public delegate void UpdateNeighbours(List<RegionInfo> neighbours); public delegate void UpdateNeighbours(List<RegionInfo> neighbours);
public delegate void AgentCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying); public delegate void AgentCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying);
public delegate void PrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical);
public delegate void AcknowledgeAgentCross(ulong regionHandle, LLUUID agentID); public delegate void AcknowledgeAgentCross(ulong regionHandle, LLUUID agentID);
public delegate void AcknowledgePrimCross(ulong regionHandle, LLUUID PrimID);
public delegate void CloseAgentConnection(ulong regionHandle, LLUUID agentID); public delegate void CloseAgentConnection(ulong regionHandle, LLUUID agentID);
public interface IRegionCommsListener public interface IRegionCommsListener
{ {
event ExpectUserDelegate OnExpectUser; event ExpectUserDelegate OnExpectUser;
event ExpectPrimDelegate OnExpectPrim;
event GenericCall2 OnExpectChildAgent; event GenericCall2 OnExpectChildAgent;
event AgentCrossing OnAvatarCrossingIntoRegion; event AgentCrossing OnAvatarCrossingIntoRegion;
event PrimCrossing OnPrimCrossingIntoRegion;
event AcknowledgeAgentCross OnAcknowledgeAgentCrossed; event AcknowledgeAgentCross OnAcknowledgeAgentCrossed;
event AcknowledgePrimCross OnAcknowledgePrimCrossed;
event UpdateNeighbours OnNeighboursUpdate; event UpdateNeighbours OnNeighboursUpdate;
event CloseAgentConnection OnCloseAgentConnection; event CloseAgentConnection OnCloseAgentConnection;
} }

View File

@ -34,10 +34,13 @@ namespace OpenSim.Framework
public class RegionCommsListener : IRegionCommsListener public class RegionCommsListener : IRegionCommsListener
{ {
public event ExpectUserDelegate OnExpectUser; public event ExpectUserDelegate OnExpectUser;
public event ExpectPrimDelegate OnExpectPrim;
public event GenericCall2 OnExpectChildAgent; public event GenericCall2 OnExpectChildAgent;
public event AgentCrossing OnAvatarCrossingIntoRegion; public event AgentCrossing OnAvatarCrossingIntoRegion;
public event PrimCrossing OnPrimCrossingIntoRegion;
public event UpdateNeighbours OnNeighboursUpdate; public event UpdateNeighbours OnNeighboursUpdate;
public event AcknowledgeAgentCross OnAcknowledgeAgentCrossed; public event AcknowledgeAgentCross OnAcknowledgeAgentCrossed;
public event AcknowledgePrimCross OnAcknowledgePrimCrossed;
public event CloseAgentConnection OnCloseAgentConnection; public event CloseAgentConnection OnCloseAgentConnection;
/// <summary> /// <summary>
@ -55,6 +58,15 @@ namespace OpenSim.Framework
return false; return false;
} }
public virtual bool TriggerExpectPrim(ulong regionHandle, LLUUID primID, string objData)
{
if (OnExpectUser != null)
{
OnExpectPrim(regionHandle, primID, objData);
return true;
}
return false;
}
public virtual bool TriggerExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, public virtual bool TriggerExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position,
bool isFlying) bool isFlying)
@ -66,6 +78,15 @@ namespace OpenSim.Framework
} }
return false; return false;
} }
public virtual bool TriggerExpectPrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical)
{
if (OnPrimCrossingIntoRegion != null)
{
OnPrimCrossingIntoRegion(regionHandle, primID, position, isPhysical);
return true;
}
return false;
}
public virtual bool TriggerAcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentID) public virtual bool TriggerAcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentID)
{ {
@ -77,6 +98,16 @@ namespace OpenSim.Framework
return false; return false;
} }
public virtual bool TriggerAcknowledgePrimCrossed(ulong regionHandle, LLUUID primID)
{
if (OnAcknowledgePrimCrossed != null)
{
OnAcknowledgePrimCrossed(regionHandle, primID);
return true;
}
return false;
}
public virtual void TriggerCloseAgentConnection(ulong regionHandle, LLUUID agentID) public virtual void TriggerCloseAgentConnection(ulong regionHandle, LLUUID agentID)
{ {
if (OnCloseAgentConnection != null) if (OnCloseAgentConnection != null)

View File

@ -59,6 +59,7 @@ namespace OpenSim
public bool m_sandbox; public bool m_sandbox;
public bool user_accounts; public bool user_accounts;
public bool m_gridLocalAsset; public bool m_gridLocalAsset;
public bool m_SendChildAgentTaskData;
private OpenSimController m_controller; private OpenSimController m_controller;
@ -156,6 +157,9 @@ namespace OpenSim
config.Set("physics", "basicphysics"); config.Set("physics", "basicphysics");
config.Set("verbose", true); config.Set("verbose", true);
config.Set("physical_prim", true); config.Set("physical_prim", true);
config.Set("child_get_tasks", false);
config.Set("serverside_object_permissions", false); config.Set("serverside_object_permissions", false);
config.Set("storage_plugin", "OpenSim.DataStore.NullStorage.dll"); config.Set("storage_plugin", "OpenSim.DataStore.NullStorage.dll");
@ -166,6 +170,7 @@ namespace OpenSim
config.Set("script_engine", "DotNetEngine"); config.Set("script_engine", "DotNetEngine");
config.Set("asset_database", "sqlite"); config.Set("asset_database", "sqlite");
} }
if (m_config.Configs["StandAlone"] == null) if (m_config.Configs["StandAlone"] == null)
@ -215,7 +220,11 @@ namespace OpenSim
m_physicsEngine = startupConfig.GetString("physics", "basicphysics"); m_physicsEngine = startupConfig.GetString("physics", "basicphysics");
m_meshEngineName = startupConfig.GetString("meshing", "ZeroMesher"); m_meshEngineName = startupConfig.GetString("meshing", "ZeroMesher");
m_verbose = startupConfig.GetBoolean("verbose", true); m_verbose = startupConfig.GetBoolean("verbose", true);
m_physicalPrim = startupConfig.GetBoolean("physical_prim", true); m_physicalPrim = startupConfig.GetBoolean("physical_prim", true);
m_SendChildAgentTaskData = startupConfig.GetBoolean("child_get_tasks", false);
m_permissions = startupConfig.GetBoolean("serverside_object_permissions", false); m_permissions = startupConfig.GetBoolean("serverside_object_permissions", false);
m_storageDll = startupConfig.GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll"); m_storageDll = startupConfig.GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll");
@ -243,7 +252,10 @@ namespace OpenSim
m_dumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false); m_dumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false);
} }
if (!m_sandbox)
m_SendChildAgentTaskData = false;
m_networkServersInfo.loadFromConfiguration(m_config); m_networkServersInfo.loadFromConfiguration(m_config);
} }
@ -368,9 +380,14 @@ namespace OpenSim
{ {
PermissionManager permissionManager = new PermissionManager(); PermissionManager permissionManager = new PermissionManager();
SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager); SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager);
if (m_SendChildAgentTaskData)
{
MainLog.Instance.Error("WARNING", "Send Child Agent Task Updates is enabled. This is for testing only. It doesn't work on grid mode!");
System.Threading.Thread.Sleep(12000);
}
return return
new Scene(regionInfo, circuitManager, permissionManager, m_commsManager, sceneGridService, m_assetCache, storageManager, m_httpServer, new Scene(regionInfo, circuitManager, permissionManager, m_commsManager, sceneGridService, m_assetCache, storageManager, m_httpServer,
m_moduleLoader, m_dumpAssetsToFile, m_physicalPrim); m_moduleLoader, m_dumpAssetsToFile, m_physicalPrim, m_SendChildAgentTaskData);
} }
protected override void Initialize() protected override void Initialize()

View File

@ -173,6 +173,15 @@ namespace OpenSim.Region.Communications.Local
return false; return false;
} }
public bool InformRegionOfPrimCrossing(ulong regionHandle, LLUUID primID, string objData)
{
if (m_regionListeners.ContainsKey(regionHandle))
{
m_regionListeners[regionHandle].TriggerExpectPrim(regionHandle, primID, objData);
return true;
}
return false;
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -190,6 +199,15 @@ namespace OpenSim.Region.Communications.Local
} }
return false; return false;
} }
public bool ExpectPrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical)
{
if (m_regionListeners.ContainsKey(regionHandle))
{
m_regionListeners[regionHandle].TriggerExpectPrimCrossing(regionHandle, primID, position, isPhysical);
return true;
}
return false;
}
public void TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID) public void TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID)
{ {
@ -207,6 +225,14 @@ namespace OpenSim.Region.Communications.Local
} }
return false; return false;
} }
public bool AcknowledgePrimCrossed(ulong regionHandle, LLUUID primID)
{
if (m_regionListeners.ContainsKey(regionHandle))
{
return true;
}
return false;
}
/// <summary> /// <summary>
/// Is a Sandbox mode method, used by the local Login server to inform a region of a connection user/session /// Is a Sandbox mode method, used by the local Login server to inform a region of a connection user/session
@ -240,6 +266,15 @@ namespace OpenSim.Region.Communications.Local
} }
} }
public void TriggerExpectPrim(ulong regionHandle, LLUUID primID, string objData)
{
if (m_regionListeners.ContainsKey(regionHandle))
{
m_regionListeners[regionHandle].TriggerExpectPrim(regionHandle, primID, objData);
}
}
public void PingCheckReply(Hashtable respData) public void PingCheckReply(Hashtable respData)
{ {
foreach (ulong region in m_regions.Keys) foreach (ulong region in m_regions.Keys)
@ -264,6 +299,15 @@ namespace OpenSim.Region.Communications.Local
return false; return false;
} }
public bool TriggerExpectPrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical)
{
if (m_regionListeners.ContainsKey(regionHandle))
{
return m_regionListeners[regionHandle].TriggerExpectPrimCrossing(regionHandle, primID, position, isPhysical);
}
return false;
}
public bool IncomingChildAgent(ulong regionHandle, AgentCircuitData agentData) public bool IncomingChildAgent(ulong regionHandle, AgentCircuitData agentData)
{ {
if (m_regionListeners.ContainsKey(regionHandle)) if (m_regionListeners.ContainsKey(regionHandle))

View File

@ -63,6 +63,7 @@ namespace OpenSim.Region.Communications.OGS1
{ {
serversInfo = servers_info; serversInfo = servers_info;
httpServer = httpServe; httpServer = httpServe;
//Respond to Grid Services requests
httpServer.AddXmlRPCHandler("expect_user", ExpectUser); httpServer.AddXmlRPCHandler("expect_user", ExpectUser);
httpServer.AddXmlRPCHandler("check", PingCheckReply); httpServer.AddXmlRPCHandler("check", PingCheckReply);
@ -340,7 +341,12 @@ namespace OpenSim.Region.Communications.OGS1
return new XmlRpcResponse(); return new XmlRpcResponse();
} }
#region m_interRegion Comms #region m_interRegion Comms
/// <summary> /// <summary>
@ -357,16 +363,22 @@ namespace OpenSim.Region.Communications.OGS1
RemotingConfiguration.RegisterWellKnownServiceType(wellType); RemotingConfiguration.RegisterWellKnownServiceType(wellType);
InterRegionSingleton.Instance.OnArrival += TriggerExpectAvatarCrossing; InterRegionSingleton.Instance.OnArrival += TriggerExpectAvatarCrossing;
InterRegionSingleton.Instance.OnChildAgent += IncomingChildAgent; InterRegionSingleton.Instance.OnChildAgent += IncomingChildAgent;
InterRegionSingleton.Instance.OnPrimGroupArrival += IncomingPrim;
InterRegionSingleton.Instance.OnPrimGroupNear += TriggerExpectPrimCrossing;
} }
#region Methods called by regions in this instance #region Methods called by regions in this instance
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
/// <param name="regionHandle"></param> /// <param name="regionHandle"></param>
/// <param name="agentData"></param> /// <param name="agentData"></param>
/// <returns></returns> /// <returns></returns>
public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
{ {
try try
@ -432,7 +444,78 @@ namespace OpenSim.Region.Communications.OGS1
} }
return true; return true;
} }
/// <summary>
///
/// </summary>
/// <param name="regionHandle"></param>
/// <param name="agentData"></param>
/// <returns></returns>
public bool InformRegionOfPrimCrossing(ulong regionHandle, LLUUID primID, string objData)
{
try
{
if (m_localBackend.InformRegionOfPrimCrossing(regionHandle,primID, objData))
{
return true;
}
RegionInfo regInfo = RequestNeighbourInfo(regionHandle);
if (regInfo != null)
{
//don't want to be creating a new link to the remote instance every time like we are here
bool retValue = false;
OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting) Activator.GetObject(
typeof (OGS1InterRegionRemoting),
"tcp://" + regInfo.RemotingAddress +
":" + regInfo.RemotingPort +
"/InterRegions");
if (remObject != null)
{
retValue = remObject.InformRegionOfPrimCrossing(regionHandle,primID, objData);
}
else
{
Console.WriteLine("remoting object not found");
}
remObject = null;
return retValue;
}
return false;
}
catch (RemotingException e)
{
MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
return false;
}
catch (SocketException e)
{
MainLog.Instance.Error("Socket Error: Unable to connect to remote region.\n" + e.ToString());
return false;
}
catch (InvalidCredentialException e)
{
MainLog.Instance.Error("Invalid Credentials: Unable to connect to remote region.\n" + e.ToString());
return false;
}
catch (AuthenticationException e)
{
MainLog.Instance.Error("Authentication exception: Unable to connect to remote region.\n" + e.ToString());
return false;
}
catch (Exception e)
{
MainLog.Instance.Error("Unknown exception: Unable to connect to remote region.\n" + e.ToString());
return false;
}
return true;
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -484,6 +567,50 @@ namespace OpenSim.Region.Communications.OGS1
return false; return false;
} }
} }
public bool ExpectPrimCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isPhysical)
{
try
{
if (m_localBackend.TriggerExpectPrimCrossing(regionHandle, agentID, position, isPhysical))
{
return true;
}
RegionInfo regInfo = RequestNeighbourInfo(regionHandle);
if (regInfo != null)
{
bool retValue = false;
OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject(
typeof(OGS1InterRegionRemoting),
"tcp://" + regInfo.RemotingAddress +
":" + regInfo.RemotingPort +
"/InterRegions");
if (remObject != null)
{
retValue = remObject.ExpectAvatarCrossing(regionHandle, agentID, position, isPhysical);
}
else
{
Console.WriteLine("remoting object not found");
}
remObject = null;
return retValue;
}
//TODO need to see if we know about where this region is and use .net remoting
// to inform it.
return false;
}
catch (RemotingException e)
{
MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
return false;
}
catch
{
return false;
}
}
public void TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID) public void TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID)
{ {
@ -495,6 +622,10 @@ namespace OpenSim.Region.Communications.OGS1
return m_localBackend.AcknowledgeAgentCrossed(regionHandle, agentId); return m_localBackend.AcknowledgeAgentCrossed(regionHandle, agentId);
} }
public bool AcknowledgePrimCrossed(ulong regionHandle, LLUUID primId)
{
return m_localBackend.AcknowledgePrimCrossed(regionHandle, primId);
}
#endregion #endregion
#region Methods triggered by calls from external instances #region Methods triggered by calls from external instances
@ -518,6 +649,27 @@ namespace OpenSim.Region.Communications.OGS1
} }
} }
/// <summary>
///
/// </summary>
/// <param name="regionHandle"></param>
/// <param name="agentData"></param>
/// <returns></returns>
public bool IncomingPrim(ulong regionHandle, LLUUID primID, string objData)
{
// Is this necessary?
try
{
//return m_localBackend.TriggerExpectPrim(regionHandle,primID, objData);
//m_localBackend.
return false;
}
catch (RemotingException e)
{
MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
return false;
}
}
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
@ -537,6 +689,18 @@ namespace OpenSim.Region.Communications.OGS1
return false; return false;
} }
} }
public bool TriggerExpectPrimCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isPhysical)
{
try
{
return m_localBackend.TriggerExpectPrimCrossing(regionHandle, agentID, position, isPhysical);
}
catch (RemotingException e)
{
MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
return false;
}
}
#endregion #endregion

View File

@ -37,12 +37,18 @@ namespace OpenSim.Region.Communications.OGS1
public delegate bool ExpectArrival(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying); public delegate bool ExpectArrival(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying);
public delegate bool InformRegionPrimGroup(ulong regionHandle, LLUUID primID, LLVector3 Positon, bool isPhysical);
public delegate bool PrimGroupArrival(ulong regionHandle, LLUUID primID, string objData);
public sealed class InterRegionSingleton public sealed class InterRegionSingleton
{ {
private static readonly InterRegionSingleton instance = new InterRegionSingleton(); private static readonly InterRegionSingleton instance = new InterRegionSingleton();
public event InformRegionChild OnChildAgent; public event InformRegionChild OnChildAgent;
public event ExpectArrival OnArrival; public event ExpectArrival OnArrival;
public event InformRegionPrimGroup OnPrimGroupNear;
public event PrimGroupArrival OnPrimGroupArrival;
static InterRegionSingleton() static InterRegionSingleton()
{ {
@ -74,6 +80,22 @@ namespace OpenSim.Region.Communications.OGS1
} }
return false; return false;
} }
public bool InformRegionPrim(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical)
{
if (OnPrimGroupNear != null)
{
return OnPrimGroupNear(regionHandle, primID, position, isPhysical);
}
return false;
}
public bool ExpectPrimCrossing(ulong regionHandle, LLUUID primID, string objData)
{
if (OnPrimGroupArrival != null)
{
return OnPrimGroupArrival(regionHandle, primID, objData);
}
return false;
}
} }
public class OGS1InterRegionRemoting : MarshalByRefObject public class OGS1InterRegionRemoting : MarshalByRefObject
@ -107,5 +129,31 @@ namespace OpenSim.Region.Communications.OGS1
return false; return false;
} }
} }
public bool InformRegionPrim(ulong regionHandle, LLUUID SceneObjectGroupID, LLVector3 position, bool isPhysical)
{
try
{
return InterRegionSingleton.Instance.InformRegionPrim(regionHandle, SceneObjectGroupID, position, isPhysical);
}
catch (RemotingException e)
{
Console.WriteLine("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
return false;
}
}
public bool InformRegionOfPrimCrossing(ulong regionHandle,LLUUID primID, string objData)
{
try
{
return InterRegionSingleton.Instance.ExpectPrimCrossing(regionHandle, primID, objData);
}
catch (RemotingException e)
{
Console.WriteLine("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
return false;
}
}
} }
} }

View File

@ -181,7 +181,7 @@ namespace OpenSim.Region.Environment.Modules
foreach (Scene m_scene in m_scenes) foreach (Scene m_scene in m_scenes)
{ {
m_scene.ForEachScenePresence(delegate(ScenePresence presence) m_scene.ForEachScenePresence(delegate(ScenePresence presence)
{ {
if (!presence.IsChildAgent) if (!presence.IsChildAgent)
{ {
int dis = -100000; int dis = -100000;

View File

@ -69,6 +69,7 @@ namespace OpenSim.Region.Environment.Scenes
private readonly Mutex updateLock; private readonly Mutex updateLock;
public bool m_physicalPrim; public bool m_physicalPrim;
public bool m_sendTasksToChild;
protected ModuleLoader m_moduleLoader; protected ModuleLoader m_moduleLoader;
protected StorageManager m_storageManager; protected StorageManager m_storageManager;
protected AgentCircuitManager m_authenticateHandler; protected AgentCircuitManager m_authenticateHandler;
@ -197,7 +198,7 @@ namespace OpenSim.Region.Environment.Scenes
public Scene(RegionInfo regInfo, AgentCircuitManager authen, PermissionManager permissionManager, CommunicationsManager commsMan, SceneCommunicationService sceneGridService, public Scene(RegionInfo regInfo, AgentCircuitManager authen, PermissionManager permissionManager, CommunicationsManager commsMan, SceneCommunicationService sceneGridService,
AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer, AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer,
ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim) ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool SendTasksToChild)
{ {
updateLock = new Mutex(false); updateLock = new Mutex(false);
@ -213,6 +214,7 @@ namespace OpenSim.Region.Environment.Scenes
m_datastore = m_regInfo.DataStore; m_datastore = m_regInfo.DataStore;
RegisterRegionWithComms(); RegisterRegionWithComms();
m_physicalPrim = physicalPrim; m_physicalPrim = physicalPrim;
m_sendTasksToChild = SendTasksToChild;
m_LandManager = new LandManager(this, m_regInfo); m_LandManager = new LandManager(this, m_regInfo);
m_estateManager = new EstateManager(this, m_regInfo); m_estateManager = new EstateManager(this, m_regInfo);

View File

@ -20,6 +20,8 @@ namespace OpenSim.Region.Environment.Scenes
public event AgentCrossing OnAvatarCrossingIntoRegion; public event AgentCrossing OnAvatarCrossingIntoRegion;
public event ExpectUserDelegate OnExpectUser; public event ExpectUserDelegate OnExpectUser;
public event CloseAgentConnection OnCloseAgentConnection; public event CloseAgentConnection OnCloseAgentConnection;
public event PrimCrossing OnPrimCrossingIntoRegion;
public SceneCommunicationService(CommunicationsManager commsMan) public SceneCommunicationService(CommunicationsManager commsMan)
{ {
@ -34,7 +36,10 @@ namespace OpenSim.Region.Environment.Scenes
{ {
regionCommsHost.OnExpectUser += NewUserConnection; regionCommsHost.OnExpectUser += NewUserConnection;
regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing; regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing;
regionCommsHost.OnPrimCrossingIntoRegion += PrimCrossing;
regionCommsHost.OnCloseAgentConnection += CloseConnection; regionCommsHost.OnCloseAgentConnection += CloseConnection;
} }
} }
@ -42,6 +47,7 @@ namespace OpenSim.Region.Environment.Scenes
{ {
regionCommsHost.OnExpectUser -= NewUserConnection; regionCommsHost.OnExpectUser -= NewUserConnection;
regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing; regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing;
regionCommsHost.OnPrimCrossingIntoRegion -= PrimCrossing;
regionCommsHost.OnCloseAgentConnection -= CloseConnection; regionCommsHost.OnCloseAgentConnection -= CloseConnection;
m_commsProvider.GridService.DeregisterRegion(m_regionInfo); m_commsProvider.GridService.DeregisterRegion(m_regionInfo);
regionCommsHost = null; regionCommsHost = null;
@ -68,6 +74,13 @@ namespace OpenSim.Region.Environment.Scenes
OnAvatarCrossingIntoRegion(regionHandle, agentID, position, isFlying); OnAvatarCrossingIntoRegion(regionHandle, agentID, position, isFlying);
} }
} }
protected void PrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical)
{
if (OnPrimCrossingIntoRegion != null)
{
OnPrimCrossingIntoRegion(regionHandle, primID, position, isPhysical);
}
}
protected void CloseConnection(ulong regionHandle, LLUUID agentID) protected void CloseConnection(ulong regionHandle, LLUUID agentID)
{ {
@ -222,6 +235,11 @@ namespace OpenSim.Region.Environment.Scenes
return m_commsProvider.InterRegion.ExpectAvatarCrossing(regionhandle, agentID, position, isFlying); return m_commsProvider.InterRegion.ExpectAvatarCrossing(regionhandle, agentID, position, isFlying);
} }
public bool PrimCrossToNeighboringRegion(ulong regionhandle, LLUUID primID, LLVector3 position, bool isPhysical)
{
return m_commsProvider.InterRegion.ExpectPrimCrossing(regionhandle, primID, position, isPhysical);
}
public void CloseChildAgentConnections(ScenePresence presence) public void CloseChildAgentConnections(ScenePresence presence)
{ {
foreach (ulong regionHandle in presence.KnownChildRegions) foreach (ulong regionHandle in presence.KnownChildRegions)

View File

@ -69,6 +69,7 @@ namespace OpenSim.Region.Environment.Scenes
private bool m_newForce = false; private bool m_newForce = false;
private bool m_newAvatar = false; private bool m_newAvatar = false;
private bool m_newCoarseLocations = true; private bool m_newCoarseLocations = true;
private bool m_gotAllObjectsInScene = false;
private float m_avHeight = 127.0f; private float m_avHeight = 127.0f;
protected RegionInfo m_regionInfo; protected RegionInfo m_regionInfo;
@ -327,7 +328,14 @@ namespace OpenSim.Region.Environment.Scenes
// this.UpdateQuadTreeNode(); // this.UpdateQuadTreeNode();
//this.RefreshQuadObject(); //this.RefreshQuadObject();
//} //}
if (!m_gotAllObjectsInScene)
{
if (!m_isChildAgent || m_scene.m_sendTasksToChild)
{
m_scene.SendAllSceneObjectsToClient(this);
m_gotAllObjectsInScene = true;
}
}
if (m_partsUpdateQueue.Count > 0) if (m_partsUpdateQueue.Count > 0)
{ {
bool runUpdate = true; bool runUpdate = true;
@ -400,7 +408,12 @@ namespace OpenSim.Region.Environment.Scenes
AddToPhysicalScene(); AddToPhysicalScene();
m_physicsActor.Flying = isFlying; m_physicsActor.Flying = isFlying;
m_scene.SendAllSceneObjectsToClient(this); if (!m_gotAllObjectsInScene)
{
m_scene.SendAllSceneObjectsToClient(this);
m_gotAllObjectsInScene = true;
}
} }
public void MakeChildAgent() public void MakeChildAgent()
@ -409,7 +422,7 @@ namespace OpenSim.Region.Environment.Scenes
m_isChildAgent = true; m_isChildAgent = true;
RemoveFromPhysicalScene(); RemoveFromPhysicalScene();
//this.Pos = new LLVector3(128, 128, 70); //this.Pos = new LLVector3(128, 128, 70);
} }
@ -952,7 +965,7 @@ namespace OpenSim.Region.Environment.Scenes
SendFullUpdateToOtherClient(avatar); SendFullUpdateToOtherClient(avatar);
if (avatar.LocalId != LocalId) if (avatar.LocalId != LocalId)
{ {
if (!avatar.m_isChildAgent) if (!avatar.m_isChildAgent || m_scene.m_sendTasksToChild)
{ {
avatar.SendFullUpdateToOtherClient(this); avatar.SendFullUpdateToOtherClient(this);
avatar.SendAppearanceToOtherAgent(this); avatar.SendAppearanceToOtherAgent(this);
@ -985,7 +998,11 @@ namespace OpenSim.Region.Environment.Scenes
public void SendOwnAppearance( ) public void SendOwnAppearance( )
{ {
SendOwnWearables( ); SendOwnWearables( );
//Ugly hack x.x - Trap set appearence to send all objects in this scene!
m_scene.SendAllSceneObjectsToClient(this); m_scene.SendAllSceneObjectsToClient(this);
m_gotAllObjectsInScene = true;
// TODO: remove this once the SunModule is slightly more tested // TODO: remove this once the SunModule is slightly more tested
// m_controllingClient.SendViewerTime(m_scene.TimePhase); // m_controllingClient.SendViewerTime(m_scene.TimePhase);
} }

View File

@ -44,8 +44,8 @@ namespace SimpleApp
public MyWorld(RegionInfo regionInfo, AgentCircuitManager authen, PermissionManager permissionManager, CommunicationsManager commsMan, SceneCommunicationService sceneGridService, public MyWorld(RegionInfo regionInfo, AgentCircuitManager authen, PermissionManager permissionManager, CommunicationsManager commsMan, SceneCommunicationService sceneGridService,
AssetCache assetCach, StorageManager storeMan, BaseHttpServer httpServer, AssetCache assetCach, StorageManager storeMan, BaseHttpServer httpServer,
ModuleLoader moduleLoader, bool physicalPrim) ModuleLoader moduleLoader, bool physicalPrim, bool ChildGetTasks)
: base(regionInfo, authen, permissionManager, commsMan, sceneGridService, assetCach, storeMan, httpServer, moduleLoader, false, true) : base(regionInfo, authen, permissionManager, commsMan, sceneGridService, assetCach, storeMan, httpServer, moduleLoader, false, true, false)
{ {
m_avatars = new List<Avatar>(); m_avatars = new List<Avatar>();
} }

View File

@ -173,7 +173,7 @@ namespace SimpleApp
SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager); SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager);
return return
new MyWorld(regionInfo, circuitManager, permissionManager, m_commsManager, sceneGridService, m_assetCache, storageManager, m_httpServer, new MyWorld(regionInfo, circuitManager, permissionManager, m_commsManager, sceneGridService, m_assetCache, storageManager, m_httpServer,
new ModuleLoader(m_log, m_config), true); new ModuleLoader(m_log, m_config), true, false);
} }
protected override StorageManager CreateStorageManager(string connectionstring) protected override StorageManager CreateStorageManager(string connectionstring)

View File

@ -604,7 +604,7 @@ namespace OpenSim.Region.Physics.OdePlugin
public IntPtr calculateSpaceForGeom(PhysicsVector pos) public IntPtr calculateSpaceForGeom(PhysicsVector pos)
{ {
int[] xyspace = calculateSpaceArrayItemFromPos(pos); int[] xyspace = calculateSpaceArrayItemFromPos(pos);
OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Attempting to use arrayItem: " + xyspace[0].ToString() + "," + xyspace[1].ToString()); //OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Attempting to use arrayItem: " + xyspace[0].ToString() + "," + xyspace[1].ToString());
IntPtr locationbasedspace = staticPrimspace[xyspace[0],xyspace[1]]; IntPtr locationbasedspace = staticPrimspace[xyspace[0],xyspace[1]];
//locationbasedspace = space; //locationbasedspace = space;