aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
authorTleiades Hax2007-10-18 15:10:43 +0000
committerTleiades Hax2007-10-18 15:10:43 +0000
commit05df8571323c535b5c1ce1b0532e88236b143b7e (patch)
tree6f275d5b682231906315363514e98b7b06557fda /OpenSim/Region/Environment/Scenes
parent* Removed some comments (diff)
downloadopensim-SC_OLD-05df8571323c535b5c1ce1b0532e88236b143b7e.zip
opensim-SC_OLD-05df8571323c535b5c1ce1b0532e88236b143b7e.tar.gz
opensim-SC_OLD-05df8571323c535b5c1ce1b0532e88236b143b7e.tar.bz2
opensim-SC_OLD-05df8571323c535b5c1ce1b0532e88236b143b7e.tar.xz
Possible fix for: Remoting exceptions with adjacent non-running sims.
Bugs 449, 454, 408, 244, 197 implemented InformClientOfNeighbours as an asynchroneous process, handling timeouts without blocking the main thread. Improved logging of errors, removed catch all in try catch
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.Inventory.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs33
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs4
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs2
4 files changed, 31 insertions, 10 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 567fbd9..ee515ea 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -403,7 +403,7 @@ namespace OpenSim.Region.Environment.Scenes
403 } 403 }
404 404
405 storageManager.DataStore.RemoveObject(((SceneObjectGroup) selectedEnt).UUID, 405 storageManager.DataStore.RemoveObject(((SceneObjectGroup) selectedEnt).UUID,
406 m_regInfo.SimUUID); 406 m_regInfo.RegionID);
407 ((SceneObjectGroup) selectedEnt).DeleteGroup(); 407 ((SceneObjectGroup) selectedEnt).DeleteGroup();
408 408
409 lock (Entities) 409 lock (Entities)
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index b0f0b9a..ab8a48a 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -26,6 +26,7 @@
26* 26*
27*/ 27*/
28using System; 28using System;
29using System.Net;
29using System.Collections.Generic; 30using System.Collections.Generic;
30using System.IO; 31using System.IO;
31using System.Threading; 32using System.Threading;
@@ -529,7 +530,7 @@ namespace OpenSim.Region.Environment.Scenes
529 public virtual void LoadPrimsFromStorage() 530 public virtual void LoadPrimsFromStorage()
530 { 531 {
531 MainLog.Instance.Verbose("Loading objects from datastore"); 532 MainLog.Instance.Verbose("Loading objects from datastore");
532 List<SceneObjectGroup> PrimsFromDB = storageManager.DataStore.LoadObjects(m_regInfo.SimUUID); 533 List<SceneObjectGroup> PrimsFromDB = storageManager.DataStore.LoadObjects(m_regInfo.RegionID);
533 foreach (SceneObjectGroup prim in PrimsFromDB) 534 foreach (SceneObjectGroup prim in PrimsFromDB)
534 { 535 {
535 AddEntityFromStorage(prim); 536 AddEntityFromStorage(prim);
@@ -964,7 +965,7 @@ namespace OpenSim.Region.Environment.Scenes
964 if (Entities.ContainsKey(entID)) 965 if (Entities.ContainsKey(entID))
965 { 966 {
966 Entities.Remove(entID); 967 Entities.Remove(entID);
967 storageManager.DataStore.RemoveObject(entID, m_regInfo.SimUUID); 968 storageManager.DataStore.RemoveObject(entID, m_regInfo.RegionID);
968 return true; 969 return true;
969 } 970 }
970 return false; 971 return false;
@@ -1062,13 +1063,32 @@ namespace OpenSim.Region.Environment.Scenes
1062 } 1063 }
1063 } 1064 }
1064 1065
1066 delegate void InformClientOfNeighbourDelegate(IClientAPI remoteClient, AgentCircuitData a, ulong regionHandle, IPEndPoint endPoint);
1067
1068 /// <summary>
1069 /// Async compnent for informing client of which neighbours exists
1070 /// </summary>
1071 /// <remarks>
1072 /// This needs to run asynchronesously, as a network timeout may block the thread for a long while
1073 /// </remarks>
1074 /// <param name="remoteClient"></param>
1075 /// <param name="a"></param>
1076 /// <param name="regionHandle"></param>
1077 /// <param name="endPoint"></param>
1078 public void InformClientOfNeighbourAsync(IClientAPI remoteClient, AgentCircuitData a, ulong regionHandle, IPEndPoint endPoint)
1079 {
1080 bool regionAccepted = commsManager.InterRegion.InformRegionOfChildAgent(regionHandle, a);
1081
1082 if (regionAccepted)
1083 remoteClient.InformClientOfNeighbour(regionHandle, endPoint);
1084 }
1085
1065 /// <summary> 1086 /// <summary>
1066 /// 1087 ///
1067 /// </summary> 1088 /// </summary>
1068 public void InformClientOfNeighbours(IClientAPI remoteClient) 1089 public void InformClientOfNeighbours(IClientAPI remoteClient)
1069 { 1090 {
1070 List<RegionInfo> neighbours = commsManager.GridService.RequestNeighbours(m_regInfo); 1091 List<SimpleRegionInfo> neighbours = commsManager.GridService.RequestNeighbours(m_regInfo.RegionLocX, m_regInfo.RegionLocY);
1071
1072 if (neighbours != null) 1092 if (neighbours != null)
1073 { 1093 {
1074 for (int i = 0; i < neighbours.Count; i++) 1094 for (int i = 0; i < neighbours.Count; i++)
@@ -1078,8 +1098,9 @@ namespace OpenSim.Region.Environment.Scenes
1078 agent.InventoryFolder = LLUUID.Zero; 1098 agent.InventoryFolder = LLUUID.Zero;
1079 agent.startpos = new LLVector3(128, 128, 70); 1099 agent.startpos = new LLVector3(128, 128, 70);
1080 agent.child = true; 1100 agent.child = true;
1081 commsManager.InterRegion.InformRegionOfChildAgent(neighbours[i].RegionHandle, agent); 1101
1082 remoteClient.InformClientOfNeighbour(neighbours[i].RegionHandle, neighbours[i].ExternalEndPoint); 1102 InformClientOfNeighbourDelegate d = new InformClientOfNeighbourDelegate(InformClientOfNeighbourAsync);
1103 IAsyncResult asyncInform = d.BeginInvoke(remoteClient, agent, neighbours[i].RegionHandle, neighbours[i].ExternalEndPoint, null, null);
1083 //this.capsHandlers[remoteClient.AgentId].CreateEstablishAgentComms("", System.Net.IPAddress.Parse(neighbours[i].CommsIPListenAddr) + ":" + neighbours[i].CommsIPListenPort); 1104 //this.capsHandlers[remoteClient.AgentId].CreateEstablishAgentComms("", System.Net.IPAddress.Parse(neighbours[i].CommsIPListenAddr) + ":" + neighbours[i].CommsIPListenPort);
1084 } 1105 }
1085 } 1106 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 9f8ea0c..21edbac 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -197,7 +197,7 @@ namespace OpenSim.Region.Environment.Scenes
197 { 197 {
198 if (m_scene != null) 198 if (m_scene != null)
199 { 199 {
200 return m_scene.RegionInfo.SimUUID; 200 return m_scene.RegionInfo.RegionID;
201 } 201 }
202 return LLUUID.Zero; 202 return LLUUID.Zero;
203 } 203 }
@@ -1173,7 +1173,7 @@ namespace OpenSim.Region.Environment.Scenes
1173 { 1173 {
1174 if (HasChanged) 1174 if (HasChanged)
1175 { 1175 {
1176 datastore.StoreObject(this, m_scene.RegionInfo.SimUUID); 1176 datastore.StoreObject(this, m_scene.RegionInfo.RegionID);
1177 HasChanged = false; 1177 HasChanged = false;
1178 } 1178 }
1179 } 1179 }
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 22a0754..2f5829a 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -770,7 +770,7 @@ namespace OpenSim.Region.Environment.Scenes
770 770
771 protected void CheckForSignificantMovement() 771 protected void CheckForSignificantMovement()
772 { 772 {
773 if (Helpers.VecDist(AbsolutePosition, posLastSignificantMove) > 2.0) 773 if (AbsolutePosition.GetDistanceTo(posLastSignificantMove) > 2.0)
774 { 774 {
775 posLastSignificantMove = AbsolutePosition; 775 posLastSignificantMove = AbsolutePosition;
776 if (OnSignificantClientMovement != null) 776 if (OnSignificantClientMovement != null)