From 7cb38712d5ad6781e672e4f1c8500ecd88d85f3e Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Wed, 21 Nov 2007 02:17:24 +0000 Subject: [PATCH] * 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. --- .../IInterRegionCommunications.cs | 7 + OpenSim/Framework/IRegionCommsListener.cs | 11 ++ OpenSim/Framework/RegionCommsListener.cs | 31 ++++ OpenSim/Region/Application/OpenSimMain.cs | 19 +- .../Local/LocalBackEndServices.cs | 44 +++++ .../Communications/OGS1/OGS1GridServices.cs | 164 ++++++++++++++++++ .../Communications/OGS1/OGS1InterSimComms.cs | 48 +++++ .../Region/Environment/Modules/ChatModule.cs | 2 +- OpenSim/Region/Environment/Scenes/Scene.cs | 4 +- .../Scenes/SceneCommunicationService.cs | 18 ++ .../Environment/Scenes/ScenePresence.cs | 25 ++- OpenSim/Region/Examples/SimpleApp/MyWorld.cs | 4 +- OpenSim/Region/Examples/SimpleApp/Program.cs | 2 +- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 2 +- 14 files changed, 370 insertions(+), 11 deletions(-) diff --git a/OpenSim/Framework/Communications/IInterRegionCommunications.cs b/OpenSim/Framework/Communications/IInterRegionCommunications.cs index e5ed136f51..94e4cf7bf8 100644 --- a/OpenSim/Framework/Communications/IInterRegionCommunications.cs +++ b/OpenSim/Framework/Communications/IInterRegionCommunications.cs @@ -32,8 +32,15 @@ namespace OpenSim.Framework.Communications public interface IInterRegionCommunications { 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 ExpectPrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, bool isFlying); + bool AcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentId); + bool AcknowledgePrimCrossed(ulong regionHandle, LLUUID primID); + void TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID); + } } \ No newline at end of file diff --git a/OpenSim/Framework/IRegionCommsListener.cs b/OpenSim/Framework/IRegionCommsListener.cs index 24c6499244..c9fc525df0 100644 --- a/OpenSim/Framework/IRegionCommsListener.cs +++ b/OpenSim/Framework/IRegionCommsListener.cs @@ -32,20 +32,31 @@ namespace OpenSim.Framework { public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent); + public delegate void ExpectPrimDelegate(ulong regionHandle, LLUUID primID, string objData); + public delegate void UpdateNeighbours(List neighbours); 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 AcknowledgePrimCross(ulong regionHandle, LLUUID PrimID); + public delegate void CloseAgentConnection(ulong regionHandle, LLUUID agentID); + + public interface IRegionCommsListener { event ExpectUserDelegate OnExpectUser; + event ExpectPrimDelegate OnExpectPrim; event GenericCall2 OnExpectChildAgent; event AgentCrossing OnAvatarCrossingIntoRegion; + event PrimCrossing OnPrimCrossingIntoRegion; event AcknowledgeAgentCross OnAcknowledgeAgentCrossed; + event AcknowledgePrimCross OnAcknowledgePrimCrossed; event UpdateNeighbours OnNeighboursUpdate; event CloseAgentConnection OnCloseAgentConnection; } diff --git a/OpenSim/Framework/RegionCommsListener.cs b/OpenSim/Framework/RegionCommsListener.cs index 84d1b02b7f..5dc9b8106e 100644 --- a/OpenSim/Framework/RegionCommsListener.cs +++ b/OpenSim/Framework/RegionCommsListener.cs @@ -34,10 +34,13 @@ namespace OpenSim.Framework public class RegionCommsListener : IRegionCommsListener { public event ExpectUserDelegate OnExpectUser; + public event ExpectPrimDelegate OnExpectPrim; public event GenericCall2 OnExpectChildAgent; public event AgentCrossing OnAvatarCrossingIntoRegion; + public event PrimCrossing OnPrimCrossingIntoRegion; public event UpdateNeighbours OnNeighboursUpdate; public event AcknowledgeAgentCross OnAcknowledgeAgentCrossed; + public event AcknowledgePrimCross OnAcknowledgePrimCrossed; public event CloseAgentConnection OnCloseAgentConnection; /// @@ -55,6 +58,15 @@ namespace OpenSim.Framework 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, bool isFlying) @@ -66,6 +78,15 @@ namespace OpenSim.Framework } 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) { @@ -77,6 +98,16 @@ namespace OpenSim.Framework 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) { if (OnCloseAgentConnection != null) diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index eb09de3809..11345c3d04 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -59,6 +59,7 @@ namespace OpenSim public bool m_sandbox; public bool user_accounts; public bool m_gridLocalAsset; + public bool m_SendChildAgentTaskData; private OpenSimController m_controller; @@ -156,6 +157,9 @@ namespace OpenSim config.Set("physics", "basicphysics"); config.Set("verbose", true); config.Set("physical_prim", true); + + config.Set("child_get_tasks", false); + config.Set("serverside_object_permissions", false); config.Set("storage_plugin", "OpenSim.DataStore.NullStorage.dll"); @@ -166,6 +170,7 @@ namespace OpenSim config.Set("script_engine", "DotNetEngine"); config.Set("asset_database", "sqlite"); + } if (m_config.Configs["StandAlone"] == null) @@ -215,7 +220,11 @@ namespace OpenSim m_physicsEngine = startupConfig.GetString("physics", "basicphysics"); m_meshEngineName = startupConfig.GetString("meshing", "ZeroMesher"); m_verbose = startupConfig.GetBoolean("verbose", 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_storageDll = startupConfig.GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll"); @@ -243,7 +252,10 @@ namespace OpenSim m_dumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false); } + if (!m_sandbox) + m_SendChildAgentTaskData = false; + m_networkServersInfo.loadFromConfiguration(m_config); } @@ -368,9 +380,14 @@ namespace OpenSim { PermissionManager permissionManager = new PermissionManager(); 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 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() diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs index 5d4e702268..4efaa23709 100644 --- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs +++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs @@ -173,6 +173,15 @@ namespace OpenSim.Region.Communications.Local 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; + } /// /// /// @@ -190,6 +199,15 @@ namespace OpenSim.Region.Communications.Local } 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) { @@ -207,6 +225,14 @@ namespace OpenSim.Region.Communications.Local } return false; } + public bool AcknowledgePrimCrossed(ulong regionHandle, LLUUID primID) + { + if (m_regionListeners.ContainsKey(regionHandle)) + { + return true; + } + return false; + } /// /// 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) { foreach (ulong region in m_regions.Keys) @@ -264,6 +299,15 @@ namespace OpenSim.Region.Communications.Local 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) { if (m_regionListeners.ContainsKey(regionHandle)) diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index d355f92b03..fe46632421 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -63,6 +63,7 @@ namespace OpenSim.Region.Communications.OGS1 { serversInfo = servers_info; httpServer = httpServe; + //Respond to Grid Services requests httpServer.AddXmlRPCHandler("expect_user", ExpectUser); httpServer.AddXmlRPCHandler("check", PingCheckReply); @@ -340,7 +341,12 @@ namespace OpenSim.Region.Communications.OGS1 return new XmlRpcResponse(); } + + + + + #region m_interRegion Comms /// @@ -357,16 +363,22 @@ namespace OpenSim.Region.Communications.OGS1 RemotingConfiguration.RegisterWellKnownServiceType(wellType); InterRegionSingleton.Instance.OnArrival += TriggerExpectAvatarCrossing; InterRegionSingleton.Instance.OnChildAgent += IncomingChildAgent; + InterRegionSingleton.Instance.OnPrimGroupArrival += IncomingPrim; + InterRegionSingleton.Instance.OnPrimGroupNear += TriggerExpectPrimCrossing; + } #region Methods called by regions in this instance + + /// /// /// /// /// /// + public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) { try @@ -432,7 +444,78 @@ namespace OpenSim.Region.Communications.OGS1 } return true; } + /// + /// + /// + /// + /// + /// + + 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; + } /// /// /// @@ -484,6 +567,50 @@ namespace OpenSim.Region.Communications.OGS1 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) { @@ -495,6 +622,10 @@ namespace OpenSim.Region.Communications.OGS1 return m_localBackend.AcknowledgeAgentCrossed(regionHandle, agentId); } + public bool AcknowledgePrimCrossed(ulong regionHandle, LLUUID primId) + { + return m_localBackend.AcknowledgePrimCrossed(regionHandle, primId); + } #endregion #region Methods triggered by calls from external instances @@ -518,6 +649,27 @@ namespace OpenSim.Region.Communications.OGS1 } } + /// + /// + /// + /// + /// + /// + 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; + } + } /// /// /// @@ -537,6 +689,18 @@ namespace OpenSim.Region.Communications.OGS1 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 diff --git a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs index a127010d58..70018fd5df 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs @@ -37,12 +37,18 @@ namespace OpenSim.Region.Communications.OGS1 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 { private static readonly InterRegionSingleton instance = new InterRegionSingleton(); public event InformRegionChild OnChildAgent; public event ExpectArrival OnArrival; + public event InformRegionPrimGroup OnPrimGroupNear; + public event PrimGroupArrival OnPrimGroupArrival; static InterRegionSingleton() { @@ -74,6 +80,22 @@ namespace OpenSim.Region.Communications.OGS1 } 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 @@ -107,5 +129,31 @@ namespace OpenSim.Region.Communications.OGS1 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; + } + } + } } \ No newline at end of file diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs index a78e4f63fa..82cec82ee3 100644 --- a/OpenSim/Region/Environment/Modules/ChatModule.cs +++ b/OpenSim/Region/Environment/Modules/ChatModule.cs @@ -181,7 +181,7 @@ namespace OpenSim.Region.Environment.Modules foreach (Scene m_scene in m_scenes) { m_scene.ForEachScenePresence(delegate(ScenePresence presence) - { + { if (!presence.IsChildAgent) { int dis = -100000; diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 405f2e3c90..90306f2337 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -69,6 +69,7 @@ namespace OpenSim.Region.Environment.Scenes private readonly Mutex updateLock; public bool m_physicalPrim; + public bool m_sendTasksToChild; protected ModuleLoader m_moduleLoader; protected StorageManager m_storageManager; 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, AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer, - ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim) + ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool SendTasksToChild) { updateLock = new Mutex(false); @@ -213,6 +214,7 @@ namespace OpenSim.Region.Environment.Scenes m_datastore = m_regInfo.DataStore; RegisterRegionWithComms(); m_physicalPrim = physicalPrim; + m_sendTasksToChild = SendTasksToChild; m_LandManager = new LandManager(this, m_regInfo); m_estateManager = new EstateManager(this, m_regInfo); diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index 4d4f78f7ec..ad7ff589dc 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs @@ -20,6 +20,8 @@ namespace OpenSim.Region.Environment.Scenes public event AgentCrossing OnAvatarCrossingIntoRegion; public event ExpectUserDelegate OnExpectUser; public event CloseAgentConnection OnCloseAgentConnection; + public event PrimCrossing OnPrimCrossingIntoRegion; + public SceneCommunicationService(CommunicationsManager commsMan) { @@ -34,7 +36,10 @@ namespace OpenSim.Region.Environment.Scenes { regionCommsHost.OnExpectUser += NewUserConnection; regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing; + regionCommsHost.OnPrimCrossingIntoRegion += PrimCrossing; regionCommsHost.OnCloseAgentConnection += CloseConnection; + + } } @@ -42,6 +47,7 @@ namespace OpenSim.Region.Environment.Scenes { regionCommsHost.OnExpectUser -= NewUserConnection; regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing; + regionCommsHost.OnPrimCrossingIntoRegion -= PrimCrossing; regionCommsHost.OnCloseAgentConnection -= CloseConnection; m_commsProvider.GridService.DeregisterRegion(m_regionInfo); regionCommsHost = null; @@ -68,6 +74,13 @@ namespace OpenSim.Region.Environment.Scenes 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) { @@ -222,6 +235,11 @@ namespace OpenSim.Region.Environment.Scenes 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) { foreach (ulong regionHandle in presence.KnownChildRegions) diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index ea8d5c46cf..be21748949 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs @@ -69,6 +69,7 @@ namespace OpenSim.Region.Environment.Scenes private bool m_newForce = false; private bool m_newAvatar = false; private bool m_newCoarseLocations = true; + private bool m_gotAllObjectsInScene = false; private float m_avHeight = 127.0f; protected RegionInfo m_regionInfo; @@ -327,7 +328,14 @@ namespace OpenSim.Region.Environment.Scenes // this.UpdateQuadTreeNode(); //this.RefreshQuadObject(); //} - + if (!m_gotAllObjectsInScene) + { + if (!m_isChildAgent || m_scene.m_sendTasksToChild) + { + m_scene.SendAllSceneObjectsToClient(this); + m_gotAllObjectsInScene = true; + } + } if (m_partsUpdateQueue.Count > 0) { bool runUpdate = true; @@ -400,7 +408,12 @@ namespace OpenSim.Region.Environment.Scenes AddToPhysicalScene(); m_physicsActor.Flying = isFlying; - m_scene.SendAllSceneObjectsToClient(this); + if (!m_gotAllObjectsInScene) + { + m_scene.SendAllSceneObjectsToClient(this); + m_gotAllObjectsInScene = true; + } + } public void MakeChildAgent() @@ -409,7 +422,7 @@ namespace OpenSim.Region.Environment.Scenes m_isChildAgent = true; RemoveFromPhysicalScene(); - + //this.Pos = new LLVector3(128, 128, 70); } @@ -952,7 +965,7 @@ namespace OpenSim.Region.Environment.Scenes SendFullUpdateToOtherClient(avatar); if (avatar.LocalId != LocalId) { - if (!avatar.m_isChildAgent) + if (!avatar.m_isChildAgent || m_scene.m_sendTasksToChild) { avatar.SendFullUpdateToOtherClient(this); avatar.SendAppearanceToOtherAgent(this); @@ -985,7 +998,11 @@ namespace OpenSim.Region.Environment.Scenes public void SendOwnAppearance( ) { SendOwnWearables( ); + + //Ugly hack x.x - Trap set appearence to send all objects in this scene! + m_scene.SendAllSceneObjectsToClient(this); + m_gotAllObjectsInScene = true; // TODO: remove this once the SunModule is slightly more tested // m_controllingClient.SendViewerTime(m_scene.TimePhase); } diff --git a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs index b501baf513..389ba47d38 100644 --- a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs +++ b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs @@ -44,8 +44,8 @@ namespace SimpleApp public MyWorld(RegionInfo regionInfo, AgentCircuitManager authen, PermissionManager permissionManager, CommunicationsManager commsMan, SceneCommunicationService sceneGridService, AssetCache assetCach, StorageManager storeMan, BaseHttpServer httpServer, - ModuleLoader moduleLoader, bool physicalPrim) - : base(regionInfo, authen, permissionManager, commsMan, sceneGridService, assetCach, storeMan, httpServer, moduleLoader, false, true) + ModuleLoader moduleLoader, bool physicalPrim, bool ChildGetTasks) + : base(regionInfo, authen, permissionManager, commsMan, sceneGridService, assetCach, storeMan, httpServer, moduleLoader, false, true, false) { m_avatars = new List(); } diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs index 10b625816c..7ed58f5baf 100644 --- a/OpenSim/Region/Examples/SimpleApp/Program.cs +++ b/OpenSim/Region/Examples/SimpleApp/Program.cs @@ -173,7 +173,7 @@ namespace SimpleApp SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager); return 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) diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 84ff60cb1b..ec7d04dc0a 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -604,7 +604,7 @@ namespace OpenSim.Region.Physics.OdePlugin public IntPtr calculateSpaceForGeom(PhysicsVector 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]]; //locationbasedspace = space;