aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Communications/IInterRegionCommunications.cs7
-rw-r--r--OpenSim/Framework/IRegionCommsListener.cs11
-rw-r--r--OpenSim/Framework/RegionCommsListener.cs31
-rw-r--r--OpenSim/Region/Application/OpenSimMain.cs19
-rw-r--r--OpenSim/Region/Communications/Local/LocalBackEndServices.cs44
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1GridServices.cs164
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs48
-rw-r--r--OpenSim/Region/Environment/Modules/ChatModule.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs4
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs18
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs25
-rw-r--r--OpenSim/Region/Examples/SimpleApp/MyWorld.cs4
-rw-r--r--OpenSim/Region/Examples/SimpleApp/Program.cs2
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs2
14 files changed, 370 insertions, 11 deletions
diff --git a/OpenSim/Framework/Communications/IInterRegionCommunications.cs b/OpenSim/Framework/Communications/IInterRegionCommunications.cs
index e5ed136..94e4cf7 100644
--- a/OpenSim/Framework/Communications/IInterRegionCommunications.cs
+++ b/OpenSim/Framework/Communications/IInterRegionCommunications.cs
@@ -32,8 +32,15 @@ namespace OpenSim.Framework.Communications
32 public interface IInterRegionCommunications 32 public interface IInterRegionCommunications
33 { 33 {
34 bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData); 34 bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData);
35 bool InformRegionOfPrimCrossing(ulong regionHandle, LLUUID primID, string objData);
36
35 bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying); 37 bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying);
38 bool ExpectPrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, bool isFlying);
39
36 bool AcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentId); 40 bool AcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentId);
41 bool AcknowledgePrimCrossed(ulong regionHandle, LLUUID primID);
42
37 void TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID); 43 void TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID);
44
38 } 45 }
39} \ No newline at end of file 46} \ No newline at end of file
diff --git a/OpenSim/Framework/IRegionCommsListener.cs b/OpenSim/Framework/IRegionCommsListener.cs
index 24c6499..c9fc525 100644
--- a/OpenSim/Framework/IRegionCommsListener.cs
+++ b/OpenSim/Framework/IRegionCommsListener.cs
@@ -32,20 +32,31 @@ namespace OpenSim.Framework
32{ 32{
33 public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent); 33 public delegate void ExpectUserDelegate(ulong regionHandle, AgentCircuitData agent);
34 34
35 public delegate void ExpectPrimDelegate(ulong regionHandle, LLUUID primID, string objData);
36
35 public delegate void UpdateNeighbours(List<RegionInfo> neighbours); 37 public delegate void UpdateNeighbours(List<RegionInfo> neighbours);
36 38
37 public delegate void AgentCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying); 39 public delegate void AgentCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying);
38 40
41 public delegate void PrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical);
42
39 public delegate void AcknowledgeAgentCross(ulong regionHandle, LLUUID agentID); 43 public delegate void AcknowledgeAgentCross(ulong regionHandle, LLUUID agentID);
40 44
45 public delegate void AcknowledgePrimCross(ulong regionHandle, LLUUID PrimID);
46
41 public delegate void CloseAgentConnection(ulong regionHandle, LLUUID agentID); 47 public delegate void CloseAgentConnection(ulong regionHandle, LLUUID agentID);
42 48
49
50
43 public interface IRegionCommsListener 51 public interface IRegionCommsListener
44 { 52 {
45 event ExpectUserDelegate OnExpectUser; 53 event ExpectUserDelegate OnExpectUser;
54 event ExpectPrimDelegate OnExpectPrim;
46 event GenericCall2 OnExpectChildAgent; 55 event GenericCall2 OnExpectChildAgent;
47 event AgentCrossing OnAvatarCrossingIntoRegion; 56 event AgentCrossing OnAvatarCrossingIntoRegion;
57 event PrimCrossing OnPrimCrossingIntoRegion;
48 event AcknowledgeAgentCross OnAcknowledgeAgentCrossed; 58 event AcknowledgeAgentCross OnAcknowledgeAgentCrossed;
59 event AcknowledgePrimCross OnAcknowledgePrimCrossed;
49 event UpdateNeighbours OnNeighboursUpdate; 60 event UpdateNeighbours OnNeighboursUpdate;
50 event CloseAgentConnection OnCloseAgentConnection; 61 event CloseAgentConnection OnCloseAgentConnection;
51 } 62 }
diff --git a/OpenSim/Framework/RegionCommsListener.cs b/OpenSim/Framework/RegionCommsListener.cs
index 84d1b02..5dc9b81 100644
--- a/OpenSim/Framework/RegionCommsListener.cs
+++ b/OpenSim/Framework/RegionCommsListener.cs
@@ -34,10 +34,13 @@ namespace OpenSim.Framework
34 public class RegionCommsListener : IRegionCommsListener 34 public class RegionCommsListener : IRegionCommsListener
35 { 35 {
36 public event ExpectUserDelegate OnExpectUser; 36 public event ExpectUserDelegate OnExpectUser;
37 public event ExpectPrimDelegate OnExpectPrim;
37 public event GenericCall2 OnExpectChildAgent; 38 public event GenericCall2 OnExpectChildAgent;
38 public event AgentCrossing OnAvatarCrossingIntoRegion; 39 public event AgentCrossing OnAvatarCrossingIntoRegion;
40 public event PrimCrossing OnPrimCrossingIntoRegion;
39 public event UpdateNeighbours OnNeighboursUpdate; 41 public event UpdateNeighbours OnNeighboursUpdate;
40 public event AcknowledgeAgentCross OnAcknowledgeAgentCrossed; 42 public event AcknowledgeAgentCross OnAcknowledgeAgentCrossed;
43 public event AcknowledgePrimCross OnAcknowledgePrimCrossed;
41 public event CloseAgentConnection OnCloseAgentConnection; 44 public event CloseAgentConnection OnCloseAgentConnection;
42 45
43 /// <summary> 46 /// <summary>
@@ -55,6 +58,15 @@ namespace OpenSim.Framework
55 58
56 return false; 59 return false;
57 } 60 }
61 public virtual bool TriggerExpectPrim(ulong regionHandle, LLUUID primID, string objData)
62 {
63 if (OnExpectUser != null)
64 {
65 OnExpectPrim(regionHandle, primID, objData);
66 return true;
67 }
68 return false;
69 }
58 70
59 public virtual bool TriggerExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, 71 public virtual bool TriggerExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position,
60 bool isFlying) 72 bool isFlying)
@@ -66,6 +78,15 @@ namespace OpenSim.Framework
66 } 78 }
67 return false; 79 return false;
68 } 80 }
81 public virtual bool TriggerExpectPrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical)
82 {
83 if (OnPrimCrossingIntoRegion != null)
84 {
85 OnPrimCrossingIntoRegion(regionHandle, primID, position, isPhysical);
86 return true;
87 }
88 return false;
89 }
69 90
70 public virtual bool TriggerAcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentID) 91 public virtual bool TriggerAcknowledgeAgentCrossed(ulong regionHandle, LLUUID agentID)
71 { 92 {
@@ -77,6 +98,16 @@ namespace OpenSim.Framework
77 return false; 98 return false;
78 } 99 }
79 100
101 public virtual bool TriggerAcknowledgePrimCrossed(ulong regionHandle, LLUUID primID)
102 {
103 if (OnAcknowledgePrimCrossed != null)
104 {
105 OnAcknowledgePrimCrossed(regionHandle, primID);
106 return true;
107 }
108 return false;
109 }
110
80 public virtual void TriggerCloseAgentConnection(ulong regionHandle, LLUUID agentID) 111 public virtual void TriggerCloseAgentConnection(ulong regionHandle, LLUUID agentID)
81 { 112 {
82 if (OnCloseAgentConnection != null) 113 if (OnCloseAgentConnection != null)
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index eb09de3..11345c3 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -59,6 +59,7 @@ namespace OpenSim
59 public bool m_sandbox; 59 public bool m_sandbox;
60 public bool user_accounts; 60 public bool user_accounts;
61 public bool m_gridLocalAsset; 61 public bool m_gridLocalAsset;
62 public bool m_SendChildAgentTaskData;
62 63
63 private OpenSimController m_controller; 64 private OpenSimController m_controller;
64 65
@@ -156,6 +157,9 @@ namespace OpenSim
156 config.Set("physics", "basicphysics"); 157 config.Set("physics", "basicphysics");
157 config.Set("verbose", true); 158 config.Set("verbose", true);
158 config.Set("physical_prim", true); 159 config.Set("physical_prim", true);
160
161 config.Set("child_get_tasks", false);
162
159 config.Set("serverside_object_permissions", false); 163 config.Set("serverside_object_permissions", false);
160 164
161 config.Set("storage_plugin", "OpenSim.DataStore.NullStorage.dll"); 165 config.Set("storage_plugin", "OpenSim.DataStore.NullStorage.dll");
@@ -166,6 +170,7 @@ namespace OpenSim
166 config.Set("script_engine", "DotNetEngine"); 170 config.Set("script_engine", "DotNetEngine");
167 171
168 config.Set("asset_database", "sqlite"); 172 config.Set("asset_database", "sqlite");
173
169 } 174 }
170 175
171 if (m_config.Configs["StandAlone"] == null) 176 if (m_config.Configs["StandAlone"] == null)
@@ -215,7 +220,11 @@ namespace OpenSim
215 m_physicsEngine = startupConfig.GetString("physics", "basicphysics"); 220 m_physicsEngine = startupConfig.GetString("physics", "basicphysics");
216 m_meshEngineName = startupConfig.GetString("meshing", "ZeroMesher"); 221 m_meshEngineName = startupConfig.GetString("meshing", "ZeroMesher");
217 m_verbose = startupConfig.GetBoolean("verbose", true); 222 m_verbose = startupConfig.GetBoolean("verbose", true);
223
218 m_physicalPrim = startupConfig.GetBoolean("physical_prim", true); 224 m_physicalPrim = startupConfig.GetBoolean("physical_prim", true);
225
226 m_SendChildAgentTaskData = startupConfig.GetBoolean("child_get_tasks", false);
227
219 m_permissions = startupConfig.GetBoolean("serverside_object_permissions", false); 228 m_permissions = startupConfig.GetBoolean("serverside_object_permissions", false);
220 229
221 m_storageDll = startupConfig.GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll"); 230 m_storageDll = startupConfig.GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll");
@@ -243,7 +252,10 @@ namespace OpenSim
243 252
244 m_dumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false); 253 m_dumpAssetsToFile = standaloneConfig.GetBoolean("dump_assets_to_file", false);
245 } 254 }
255 if (!m_sandbox)
256 m_SendChildAgentTaskData = false;
246 257
258
247 m_networkServersInfo.loadFromConfiguration(m_config); 259 m_networkServersInfo.loadFromConfiguration(m_config);
248 } 260 }
249 261
@@ -368,9 +380,14 @@ namespace OpenSim
368 { 380 {
369 PermissionManager permissionManager = new PermissionManager(); 381 PermissionManager permissionManager = new PermissionManager();
370 SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager); 382 SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager);
383 if (m_SendChildAgentTaskData)
384 {
385 MainLog.Instance.Error("WARNING", "Send Child Agent Task Updates is enabled. This is for testing only. It doesn't work on grid mode!");
386 System.Threading.Thread.Sleep(12000);
387 }
371 return 388 return
372 new Scene(regionInfo, circuitManager, permissionManager, m_commsManager, sceneGridService, m_assetCache, storageManager, m_httpServer, 389 new Scene(regionInfo, circuitManager, permissionManager, m_commsManager, sceneGridService, m_assetCache, storageManager, m_httpServer,
373 m_moduleLoader, m_dumpAssetsToFile, m_physicalPrim); 390 m_moduleLoader, m_dumpAssetsToFile, m_physicalPrim, m_SendChildAgentTaskData);
374 } 391 }
375 392
376 protected override void Initialize() 393 protected override void Initialize()
diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
index 5d4e702..4efaa23 100644
--- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
@@ -173,6 +173,15 @@ namespace OpenSim.Region.Communications.Local
173 return false; 173 return false;
174 } 174 }
175 175
176 public bool InformRegionOfPrimCrossing(ulong regionHandle, LLUUID primID, string objData)
177 {
178 if (m_regionListeners.ContainsKey(regionHandle))
179 {
180 m_regionListeners[regionHandle].TriggerExpectPrim(regionHandle, primID, objData);
181 return true;
182 }
183 return false;
184 }
176 /// <summary> 185 /// <summary>
177 /// 186 ///
178 /// </summary> 187 /// </summary>
@@ -190,6 +199,15 @@ namespace OpenSim.Region.Communications.Local
190 } 199 }
191 return false; 200 return false;
192 } 201 }
202 public bool ExpectPrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical)
203 {
204 if (m_regionListeners.ContainsKey(regionHandle))
205 {
206 m_regionListeners[regionHandle].TriggerExpectPrimCrossing(regionHandle, primID, position, isPhysical);
207 return true;
208 }
209 return false;
210 }
193 211
194 public void TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID) 212 public void TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID)
195 { 213 {
@@ -207,6 +225,14 @@ namespace OpenSim.Region.Communications.Local
207 } 225 }
208 return false; 226 return false;
209 } 227 }
228 public bool AcknowledgePrimCrossed(ulong regionHandle, LLUUID primID)
229 {
230 if (m_regionListeners.ContainsKey(regionHandle))
231 {
232 return true;
233 }
234 return false;
235 }
210 236
211 /// <summary> 237 /// <summary>
212 /// Is a Sandbox mode method, used by the local Login server to inform a region of a connection user/session 238 /// 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
240 } 266 }
241 } 267 }
242 268
269 public void TriggerExpectPrim(ulong regionHandle, LLUUID primID, string objData)
270 {
271 if (m_regionListeners.ContainsKey(regionHandle))
272 {
273 m_regionListeners[regionHandle].TriggerExpectPrim(regionHandle, primID, objData);
274 }
275
276 }
277
243 public void PingCheckReply(Hashtable respData) 278 public void PingCheckReply(Hashtable respData)
244 { 279 {
245 foreach (ulong region in m_regions.Keys) 280 foreach (ulong region in m_regions.Keys)
@@ -264,6 +299,15 @@ namespace OpenSim.Region.Communications.Local
264 return false; 299 return false;
265 } 300 }
266 301
302 public bool TriggerExpectPrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical)
303 {
304 if (m_regionListeners.ContainsKey(regionHandle))
305 {
306 return m_regionListeners[regionHandle].TriggerExpectPrimCrossing(regionHandle, primID, position, isPhysical);
307 }
308 return false;
309 }
310
267 public bool IncomingChildAgent(ulong regionHandle, AgentCircuitData agentData) 311 public bool IncomingChildAgent(ulong regionHandle, AgentCircuitData agentData)
268 { 312 {
269 if (m_regionListeners.ContainsKey(regionHandle)) 313 if (m_regionListeners.ContainsKey(regionHandle))
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index d355f92..fe46632 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -63,6 +63,7 @@ namespace OpenSim.Region.Communications.OGS1
63 { 63 {
64 serversInfo = servers_info; 64 serversInfo = servers_info;
65 httpServer = httpServe; 65 httpServer = httpServe;
66 //Respond to Grid Services requests
66 httpServer.AddXmlRPCHandler("expect_user", ExpectUser); 67 httpServer.AddXmlRPCHandler("expect_user", ExpectUser);
67 httpServer.AddXmlRPCHandler("check", PingCheckReply); 68 httpServer.AddXmlRPCHandler("check", PingCheckReply);
68 69
@@ -340,7 +341,12 @@ namespace OpenSim.Region.Communications.OGS1
340 341
341 return new XmlRpcResponse(); 342 return new XmlRpcResponse();
342 } 343 }
344
343 345
346
347
348
349
344 #region m_interRegion Comms 350 #region m_interRegion Comms
345 351
346 /// <summary> 352 /// <summary>
@@ -357,16 +363,22 @@ namespace OpenSim.Region.Communications.OGS1
357 RemotingConfiguration.RegisterWellKnownServiceType(wellType); 363 RemotingConfiguration.RegisterWellKnownServiceType(wellType);
358 InterRegionSingleton.Instance.OnArrival += TriggerExpectAvatarCrossing; 364 InterRegionSingleton.Instance.OnArrival += TriggerExpectAvatarCrossing;
359 InterRegionSingleton.Instance.OnChildAgent += IncomingChildAgent; 365 InterRegionSingleton.Instance.OnChildAgent += IncomingChildAgent;
366 InterRegionSingleton.Instance.OnPrimGroupArrival += IncomingPrim;
367 InterRegionSingleton.Instance.OnPrimGroupNear += TriggerExpectPrimCrossing;
368
360 } 369 }
361 370
362 #region Methods called by regions in this instance 371 #region Methods called by regions in this instance
363 372
373
374
364 /// <summary> 375 /// <summary>
365 /// 376 ///
366 /// </summary> 377 /// </summary>
367 /// <param name="regionHandle"></param> 378 /// <param name="regionHandle"></param>
368 /// <param name="agentData"></param> 379 /// <param name="agentData"></param>
369 /// <returns></returns> 380 /// <returns></returns>
381
370 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) 382 public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData)
371 { 383 {
372 try 384 try
@@ -432,7 +444,78 @@ namespace OpenSim.Region.Communications.OGS1
432 } 444 }
433 return true; 445 return true;
434 } 446 }
447 /// <summary>
448 ///
449 /// </summary>
450 /// <param name="regionHandle"></param>
451 /// <param name="agentData"></param>
452 /// <returns></returns>
453
454 public bool InformRegionOfPrimCrossing(ulong regionHandle, LLUUID primID, string objData)
455 {
456 try
457 {
458 if (m_localBackend.InformRegionOfPrimCrossing(regionHandle,primID, objData))
459 {
460 return true;
461 }
435 462
463 RegionInfo regInfo = RequestNeighbourInfo(regionHandle);
464 if (regInfo != null)
465 {
466 //don't want to be creating a new link to the remote instance every time like we are here
467 bool retValue = false;
468
469
470 OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting) Activator.GetObject(
471 typeof (OGS1InterRegionRemoting),
472 "tcp://" + regInfo.RemotingAddress +
473 ":" + regInfo.RemotingPort +
474 "/InterRegions");
475
476 if (remObject != null)
477 {
478 retValue = remObject.InformRegionOfPrimCrossing(regionHandle,primID, objData);
479 }
480 else
481 {
482 Console.WriteLine("remoting object not found");
483 }
484 remObject = null;
485
486
487 return retValue;
488 }
489
490 return false;
491 }
492 catch (RemotingException e)
493 {
494 MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
495 return false;
496 }
497 catch (SocketException e)
498 {
499 MainLog.Instance.Error("Socket Error: Unable to connect to remote region.\n" + e.ToString());
500 return false;
501 }
502 catch (InvalidCredentialException e)
503 {
504 MainLog.Instance.Error("Invalid Credentials: Unable to connect to remote region.\n" + e.ToString());
505 return false;
506 }
507 catch (AuthenticationException e)
508 {
509 MainLog.Instance.Error("Authentication exception: Unable to connect to remote region.\n" + e.ToString());
510 return false;
511 }
512 catch (Exception e)
513 {
514 MainLog.Instance.Error("Unknown exception: Unable to connect to remote region.\n" + e.ToString());
515 return false;
516 }
517 return true;
518 }
436 /// <summary> 519 /// <summary>
437 /// 520 ///
438 /// </summary> 521 /// </summary>
@@ -484,6 +567,50 @@ namespace OpenSim.Region.Communications.OGS1
484 return false; 567 return false;
485 } 568 }
486 } 569 }
570 public bool ExpectPrimCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isPhysical)
571 {
572 try
573 {
574 if (m_localBackend.TriggerExpectPrimCrossing(regionHandle, agentID, position, isPhysical))
575 {
576 return true;
577 }
578
579 RegionInfo regInfo = RequestNeighbourInfo(regionHandle);
580 if (regInfo != null)
581 {
582 bool retValue = false;
583 OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject(
584 typeof(OGS1InterRegionRemoting),
585 "tcp://" + regInfo.RemotingAddress +
586 ":" + regInfo.RemotingPort +
587 "/InterRegions");
588 if (remObject != null)
589 {
590 retValue = remObject.ExpectAvatarCrossing(regionHandle, agentID, position, isPhysical);
591 }
592 else
593 {
594 Console.WriteLine("remoting object not found");
595 }
596 remObject = null;
597
598 return retValue;
599 }
600 //TODO need to see if we know about where this region is and use .net remoting
601 // to inform it.
602 return false;
603 }
604 catch (RemotingException e)
605 {
606 MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
607 return false;
608 }
609 catch
610 {
611 return false;
612 }
613 }
487 614
488 public void TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID) 615 public void TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID)
489 { 616 {
@@ -495,6 +622,10 @@ namespace OpenSim.Region.Communications.OGS1
495 return m_localBackend.AcknowledgeAgentCrossed(regionHandle, agentId); 622 return m_localBackend.AcknowledgeAgentCrossed(regionHandle, agentId);
496 } 623 }
497 624
625 public bool AcknowledgePrimCrossed(ulong regionHandle, LLUUID primId)
626 {
627 return m_localBackend.AcknowledgePrimCrossed(regionHandle, primId);
628 }
498 #endregion 629 #endregion
499 630
500 #region Methods triggered by calls from external instances 631 #region Methods triggered by calls from external instances
@@ -522,6 +653,27 @@ namespace OpenSim.Region.Communications.OGS1
522 /// 653 ///
523 /// </summary> 654 /// </summary>
524 /// <param name="regionHandle"></param> 655 /// <param name="regionHandle"></param>
656 /// <param name="agentData"></param>
657 /// <returns></returns>
658 public bool IncomingPrim(ulong regionHandle, LLUUID primID, string objData)
659 {
660 // Is this necessary?
661 try
662 {
663 //return m_localBackend.TriggerExpectPrim(regionHandle,primID, objData);
664 //m_localBackend.
665 return false;
666 }
667 catch (RemotingException e)
668 {
669 MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
670 return false;
671 }
672 }
673 /// <summary>
674 ///
675 /// </summary>
676 /// <param name="regionHandle"></param>
525 /// <param name="agentID"></param> 677 /// <param name="agentID"></param>
526 /// <param name="position"></param> 678 /// <param name="position"></param>
527 /// <returns></returns> 679 /// <returns></returns>
@@ -537,6 +689,18 @@ namespace OpenSim.Region.Communications.OGS1
537 return false; 689 return false;
538 } 690 }
539 } 691 }
692 public bool TriggerExpectPrimCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isPhysical)
693 {
694 try
695 {
696 return m_localBackend.TriggerExpectPrimCrossing(regionHandle, agentID, position, isPhysical);
697 }
698 catch (RemotingException e)
699 {
700 MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
701 return false;
702 }
703 }
540 704
541 #endregion 705 #endregion
542 706
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs
index a127010..70018fd 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs
@@ -37,12 +37,18 @@ namespace OpenSim.Region.Communications.OGS1
37 37
38 public delegate bool ExpectArrival(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying); 38 public delegate bool ExpectArrival(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying);
39 39
40 public delegate bool InformRegionPrimGroup(ulong regionHandle, LLUUID primID, LLVector3 Positon, bool isPhysical);
41
42 public delegate bool PrimGroupArrival(ulong regionHandle, LLUUID primID, string objData);
43
40 public sealed class InterRegionSingleton 44 public sealed class InterRegionSingleton
41 { 45 {
42 private static readonly InterRegionSingleton instance = new InterRegionSingleton(); 46 private static readonly InterRegionSingleton instance = new InterRegionSingleton();
43 47
44 public event InformRegionChild OnChildAgent; 48 public event InformRegionChild OnChildAgent;
45 public event ExpectArrival OnArrival; 49 public event ExpectArrival OnArrival;
50 public event InformRegionPrimGroup OnPrimGroupNear;
51 public event PrimGroupArrival OnPrimGroupArrival;
46 52
47 static InterRegionSingleton() 53 static InterRegionSingleton()
48 { 54 {
@@ -74,6 +80,22 @@ namespace OpenSim.Region.Communications.OGS1
74 } 80 }
75 return false; 81 return false;
76 } 82 }
83 public bool InformRegionPrim(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical)
84 {
85 if (OnPrimGroupNear != null)
86 {
87 return OnPrimGroupNear(regionHandle, primID, position, isPhysical);
88 }
89 return false;
90 }
91 public bool ExpectPrimCrossing(ulong regionHandle, LLUUID primID, string objData)
92 {
93 if (OnPrimGroupArrival != null)
94 {
95 return OnPrimGroupArrival(regionHandle, primID, objData);
96 }
97 return false;
98 }
77 } 99 }
78 100
79 public class OGS1InterRegionRemoting : MarshalByRefObject 101 public class OGS1InterRegionRemoting : MarshalByRefObject
@@ -107,5 +129,31 @@ namespace OpenSim.Region.Communications.OGS1
107 return false; 129 return false;
108 } 130 }
109 } 131 }
132 public bool InformRegionPrim(ulong regionHandle, LLUUID SceneObjectGroupID, LLVector3 position, bool isPhysical)
133 {
134 try
135 {
136 return InterRegionSingleton.Instance.InformRegionPrim(regionHandle, SceneObjectGroupID, position, isPhysical);
137 }
138 catch (RemotingException e)
139 {
140 Console.WriteLine("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
141 return false;
142 }
143
144 }
145 public bool InformRegionOfPrimCrossing(ulong regionHandle,LLUUID primID, string objData)
146 {
147 try
148 {
149 return InterRegionSingleton.Instance.ExpectPrimCrossing(regionHandle, primID, objData);
150 }
151 catch (RemotingException e)
152 {
153 Console.WriteLine("Remoting Error: Unable to connect to remote region.\n" + e.ToString());
154 return false;
155 }
156 }
157
110 } 158 }
111} \ No newline at end of file 159} \ No newline at end of file
diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs
index a78e4f6..82cec82 100644
--- a/OpenSim/Region/Environment/Modules/ChatModule.cs
+++ b/OpenSim/Region/Environment/Modules/ChatModule.cs
@@ -181,7 +181,7 @@ namespace OpenSim.Region.Environment.Modules
181 foreach (Scene m_scene in m_scenes) 181 foreach (Scene m_scene in m_scenes)
182 { 182 {
183 m_scene.ForEachScenePresence(delegate(ScenePresence presence) 183 m_scene.ForEachScenePresence(delegate(ScenePresence presence)
184 { 184 {
185 if (!presence.IsChildAgent) 185 if (!presence.IsChildAgent)
186 { 186 {
187 int dis = -100000; 187 int dis = -100000;
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 405f2e3..90306f2 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -69,6 +69,7 @@ namespace OpenSim.Region.Environment.Scenes
69 69
70 private readonly Mutex updateLock; 70 private readonly Mutex updateLock;
71 public bool m_physicalPrim; 71 public bool m_physicalPrim;
72 public bool m_sendTasksToChild;
72 protected ModuleLoader m_moduleLoader; 73 protected ModuleLoader m_moduleLoader;
73 protected StorageManager m_storageManager; 74 protected StorageManager m_storageManager;
74 protected AgentCircuitManager m_authenticateHandler; 75 protected AgentCircuitManager m_authenticateHandler;
@@ -197,7 +198,7 @@ namespace OpenSim.Region.Environment.Scenes
197 198
198 public Scene(RegionInfo regInfo, AgentCircuitManager authen, PermissionManager permissionManager, CommunicationsManager commsMan, SceneCommunicationService sceneGridService, 199 public Scene(RegionInfo regInfo, AgentCircuitManager authen, PermissionManager permissionManager, CommunicationsManager commsMan, SceneCommunicationService sceneGridService,
199 AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer, 200 AssetCache assetCach, StorageManager storeManager, BaseHttpServer httpServer,
200 ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim) 201 ModuleLoader moduleLoader, bool dumpAssetsToFile, bool physicalPrim, bool SendTasksToChild)
201 { 202 {
202 updateLock = new Mutex(false); 203 updateLock = new Mutex(false);
203 204
@@ -213,6 +214,7 @@ namespace OpenSim.Region.Environment.Scenes
213 m_datastore = m_regInfo.DataStore; 214 m_datastore = m_regInfo.DataStore;
214 RegisterRegionWithComms(); 215 RegisterRegionWithComms();
215 m_physicalPrim = physicalPrim; 216 m_physicalPrim = physicalPrim;
217 m_sendTasksToChild = SendTasksToChild;
216 218
217 m_LandManager = new LandManager(this, m_regInfo); 219 m_LandManager = new LandManager(this, m_regInfo);
218 m_estateManager = new EstateManager(this, m_regInfo); 220 m_estateManager = new EstateManager(this, m_regInfo);
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
index 4d4f78f..ad7ff58 100644
--- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
@@ -20,6 +20,8 @@ namespace OpenSim.Region.Environment.Scenes
20 public event AgentCrossing OnAvatarCrossingIntoRegion; 20 public event AgentCrossing OnAvatarCrossingIntoRegion;
21 public event ExpectUserDelegate OnExpectUser; 21 public event ExpectUserDelegate OnExpectUser;
22 public event CloseAgentConnection OnCloseAgentConnection; 22 public event CloseAgentConnection OnCloseAgentConnection;
23 public event PrimCrossing OnPrimCrossingIntoRegion;
24
23 25
24 public SceneCommunicationService(CommunicationsManager commsMan) 26 public SceneCommunicationService(CommunicationsManager commsMan)
25 { 27 {
@@ -34,7 +36,10 @@ namespace OpenSim.Region.Environment.Scenes
34 { 36 {
35 regionCommsHost.OnExpectUser += NewUserConnection; 37 regionCommsHost.OnExpectUser += NewUserConnection;
36 regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing; 38 regionCommsHost.OnAvatarCrossingIntoRegion += AgentCrossing;
39 regionCommsHost.OnPrimCrossingIntoRegion += PrimCrossing;
37 regionCommsHost.OnCloseAgentConnection += CloseConnection; 40 regionCommsHost.OnCloseAgentConnection += CloseConnection;
41
42
38 } 43 }
39 } 44 }
40 45
@@ -42,6 +47,7 @@ namespace OpenSim.Region.Environment.Scenes
42 { 47 {
43 regionCommsHost.OnExpectUser -= NewUserConnection; 48 regionCommsHost.OnExpectUser -= NewUserConnection;
44 regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing; 49 regionCommsHost.OnAvatarCrossingIntoRegion -= AgentCrossing;
50 regionCommsHost.OnPrimCrossingIntoRegion -= PrimCrossing;
45 regionCommsHost.OnCloseAgentConnection -= CloseConnection; 51 regionCommsHost.OnCloseAgentConnection -= CloseConnection;
46 m_commsProvider.GridService.DeregisterRegion(m_regionInfo); 52 m_commsProvider.GridService.DeregisterRegion(m_regionInfo);
47 regionCommsHost = null; 53 regionCommsHost = null;
@@ -68,6 +74,13 @@ namespace OpenSim.Region.Environment.Scenes
68 OnAvatarCrossingIntoRegion(regionHandle, agentID, position, isFlying); 74 OnAvatarCrossingIntoRegion(regionHandle, agentID, position, isFlying);
69 } 75 }
70 } 76 }
77 protected void PrimCrossing(ulong regionHandle, LLUUID primID, LLVector3 position, bool isPhysical)
78 {
79 if (OnPrimCrossingIntoRegion != null)
80 {
81 OnPrimCrossingIntoRegion(regionHandle, primID, position, isPhysical);
82 }
83 }
71 84
72 protected void CloseConnection(ulong regionHandle, LLUUID agentID) 85 protected void CloseConnection(ulong regionHandle, LLUUID agentID)
73 { 86 {
@@ -222,6 +235,11 @@ namespace OpenSim.Region.Environment.Scenes
222 return m_commsProvider.InterRegion.ExpectAvatarCrossing(regionhandle, agentID, position, isFlying); 235 return m_commsProvider.InterRegion.ExpectAvatarCrossing(regionhandle, agentID, position, isFlying);
223 } 236 }
224 237
238 public bool PrimCrossToNeighboringRegion(ulong regionhandle, LLUUID primID, LLVector3 position, bool isPhysical)
239 {
240 return m_commsProvider.InterRegion.ExpectPrimCrossing(regionhandle, primID, position, isPhysical);
241 }
242
225 public void CloseChildAgentConnections(ScenePresence presence) 243 public void CloseChildAgentConnections(ScenePresence presence)
226 { 244 {
227 foreach (ulong regionHandle in presence.KnownChildRegions) 245 foreach (ulong regionHandle in presence.KnownChildRegions)
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index ea8d5c4..be21748 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -69,6 +69,7 @@ namespace OpenSim.Region.Environment.Scenes
69 private bool m_newForce = false; 69 private bool m_newForce = false;
70 private bool m_newAvatar = false; 70 private bool m_newAvatar = false;
71 private bool m_newCoarseLocations = true; 71 private bool m_newCoarseLocations = true;
72 private bool m_gotAllObjectsInScene = false;
72 private float m_avHeight = 127.0f; 73 private float m_avHeight = 127.0f;
73 74
74 protected RegionInfo m_regionInfo; 75 protected RegionInfo m_regionInfo;
@@ -327,7 +328,14 @@ namespace OpenSim.Region.Environment.Scenes
327 // this.UpdateQuadTreeNode(); 328 // this.UpdateQuadTreeNode();
328 //this.RefreshQuadObject(); 329 //this.RefreshQuadObject();
329 //} 330 //}
330 331 if (!m_gotAllObjectsInScene)
332 {
333 if (!m_isChildAgent || m_scene.m_sendTasksToChild)
334 {
335 m_scene.SendAllSceneObjectsToClient(this);
336 m_gotAllObjectsInScene = true;
337 }
338 }
331 if (m_partsUpdateQueue.Count > 0) 339 if (m_partsUpdateQueue.Count > 0)
332 { 340 {
333 bool runUpdate = true; 341 bool runUpdate = true;
@@ -400,7 +408,12 @@ namespace OpenSim.Region.Environment.Scenes
400 AddToPhysicalScene(); 408 AddToPhysicalScene();
401 m_physicsActor.Flying = isFlying; 409 m_physicsActor.Flying = isFlying;
402 410
403 m_scene.SendAllSceneObjectsToClient(this); 411 if (!m_gotAllObjectsInScene)
412 {
413 m_scene.SendAllSceneObjectsToClient(this);
414 m_gotAllObjectsInScene = true;
415 }
416
404 } 417 }
405 418
406 public void MakeChildAgent() 419 public void MakeChildAgent()
@@ -409,7 +422,7 @@ namespace OpenSim.Region.Environment.Scenes
409 m_isChildAgent = true; 422 m_isChildAgent = true;
410 423
411 RemoveFromPhysicalScene(); 424 RemoveFromPhysicalScene();
412 425
413 //this.Pos = new LLVector3(128, 128, 70); 426 //this.Pos = new LLVector3(128, 128, 70);
414 } 427 }
415 428
@@ -952,7 +965,7 @@ namespace OpenSim.Region.Environment.Scenes
952 SendFullUpdateToOtherClient(avatar); 965 SendFullUpdateToOtherClient(avatar);
953 if (avatar.LocalId != LocalId) 966 if (avatar.LocalId != LocalId)
954 { 967 {
955 if (!avatar.m_isChildAgent) 968 if (!avatar.m_isChildAgent || m_scene.m_sendTasksToChild)
956 { 969 {
957 avatar.SendFullUpdateToOtherClient(this); 970 avatar.SendFullUpdateToOtherClient(this);
958 avatar.SendAppearanceToOtherAgent(this); 971 avatar.SendAppearanceToOtherAgent(this);
@@ -985,7 +998,11 @@ namespace OpenSim.Region.Environment.Scenes
985 public void SendOwnAppearance( ) 998 public void SendOwnAppearance( )
986 { 999 {
987 SendOwnWearables( ); 1000 SendOwnWearables( );
1001
1002 //Ugly hack x.x - Trap set appearence to send all objects in this scene!
1003
988 m_scene.SendAllSceneObjectsToClient(this); 1004 m_scene.SendAllSceneObjectsToClient(this);
1005 m_gotAllObjectsInScene = true;
989 // TODO: remove this once the SunModule is slightly more tested 1006 // TODO: remove this once the SunModule is slightly more tested
990 // m_controllingClient.SendViewerTime(m_scene.TimePhase); 1007 // m_controllingClient.SendViewerTime(m_scene.TimePhase);
991 } 1008 }
diff --git a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
index b501baf..389ba47 100644
--- a/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
+++ b/OpenSim/Region/Examples/SimpleApp/MyWorld.cs
@@ -44,8 +44,8 @@ namespace SimpleApp
44 44
45 public MyWorld(RegionInfo regionInfo, AgentCircuitManager authen, PermissionManager permissionManager, CommunicationsManager commsMan, SceneCommunicationService sceneGridService, 45 public MyWorld(RegionInfo regionInfo, AgentCircuitManager authen, PermissionManager permissionManager, CommunicationsManager commsMan, SceneCommunicationService sceneGridService,
46 AssetCache assetCach, StorageManager storeMan, BaseHttpServer httpServer, 46 AssetCache assetCach, StorageManager storeMan, BaseHttpServer httpServer,
47 ModuleLoader moduleLoader, bool physicalPrim) 47 ModuleLoader moduleLoader, bool physicalPrim, bool ChildGetTasks)
48 : base(regionInfo, authen, permissionManager, commsMan, sceneGridService, assetCach, storeMan, httpServer, moduleLoader, false, true) 48 : base(regionInfo, authen, permissionManager, commsMan, sceneGridService, assetCach, storeMan, httpServer, moduleLoader, false, true, false)
49 { 49 {
50 m_avatars = new List<Avatar>(); 50 m_avatars = new List<Avatar>();
51 } 51 }
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs
index 10b6258..7ed58f5 100644
--- a/OpenSim/Region/Examples/SimpleApp/Program.cs
+++ b/OpenSim/Region/Examples/SimpleApp/Program.cs
@@ -173,7 +173,7 @@ namespace SimpleApp
173 SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager); 173 SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager);
174 return 174 return
175 new MyWorld(regionInfo, circuitManager, permissionManager, m_commsManager, sceneGridService, m_assetCache, storageManager, m_httpServer, 175 new MyWorld(regionInfo, circuitManager, permissionManager, m_commsManager, sceneGridService, m_assetCache, storageManager, m_httpServer,
176 new ModuleLoader(m_log, m_config), true); 176 new ModuleLoader(m_log, m_config), true, false);
177 } 177 }
178 178
179 protected override StorageManager CreateStorageManager(string connectionstring) 179 protected override StorageManager CreateStorageManager(string connectionstring)
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index 84ff60c..ec7d04d 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -604,7 +604,7 @@ namespace OpenSim.Region.Physics.OdePlugin
604 public IntPtr calculateSpaceForGeom(PhysicsVector pos) 604 public IntPtr calculateSpaceForGeom(PhysicsVector pos)
605 { 605 {
606 int[] xyspace = calculateSpaceArrayItemFromPos(pos); 606 int[] xyspace = calculateSpaceArrayItemFromPos(pos);
607 OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Attempting to use arrayItem: " + xyspace[0].ToString() + "," + xyspace[1].ToString()); 607 //OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Attempting to use arrayItem: " + xyspace[0].ToString() + "," + xyspace[1].ToString());
608 IntPtr locationbasedspace = staticPrimspace[xyspace[0],xyspace[1]]; 608 IntPtr locationbasedspace = staticPrimspace[xyspace[0],xyspace[1]];
609 609
610 //locationbasedspace = space; 610 //locationbasedspace = space;