aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications
diff options
context:
space:
mode:
authorTeravus Ovares2007-11-21 02:17:24 +0000
committerTeravus Ovares2007-11-21 02:17:24 +0000
commit7cb38712d5ad6781e672e4f1c8500ecd88d85f3e (patch)
tree5203c9901fdbba5ec8d9a21880d7895f593af540 /OpenSim/Region/Communications
parentfix for mantis #2 from Justin Casey (IBM) (diff)
downloadopensim-SC-7cb38712d5ad6781e672e4f1c8500ecd88d85f3e.zip
opensim-SC-7cb38712d5ad6781e672e4f1c8500ecd88d85f3e.tar.gz
opensim-SC-7cb38712d5ad6781e672e4f1c8500ecd88d85f3e.tar.bz2
opensim-SC-7cb38712d5ad6781e672e4f1c8500ecd88d85f3e.tar.xz
* 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.
Diffstat (limited to 'OpenSim/Region/Communications')
-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
3 files changed, 256 insertions, 0 deletions
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