From b7d596a6af51bea7dba642cdc768ac5ff77af5f3 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Wed, 28 Nov 2007 06:18:07 +0000 Subject: * Restaring the sim works fine in grid mode now. Sims announce themselves to their neighbors when they start up. Neighbors get this message and tell their agents that there's a new sim up. * Certain unrecoverable physics based crashes in ODE are now hooked up to the 'restart the sim' routine. --- .../Region/Communications/OGS1/OGS1GridServices.cs | 38 +++++++++------------- .../Communications/OGS1/OGS1InterSimComms.cs | 10 +++--- 2 files changed, 22 insertions(+), 26 deletions(-) (limited to 'OpenSim/Region/Communications/OGS1') diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 282b720..b0442d2 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -133,14 +133,10 @@ namespace OpenSim.Region.Communications.OGS1 } else { - //m_knownRegions = RequestNeighbours(regionInfo.RegionLocX, regionInfo.RegionLocY); + m_knownRegions = RequestNeighbours(regionInfo.RegionLocX, regionInfo.RegionLocY); } - //SimpleRegionInfo regiondata = new SimpleRegionInfo(); - //regiondata.RegionID = griddatahash["UUID"]; - //regiondata.RemotingAddress = - return m_localBackend.RegisterRegion(regionInfo); } @@ -458,7 +454,7 @@ namespace OpenSim.Region.Communications.OGS1 InterRegionSingleton.Instance.OnPrimGroupArrival += IncomingPrim; InterRegionSingleton.Instance.OnPrimGroupNear += TriggerExpectPrimCrossing; InterRegionSingleton.Instance.OnRegionUp += TriggerRegionUp; - InterRegionSingleton.Instance.OnRegionUp += RegionUp; + //InterRegionSingleton.Instance.OnRegionUp += RegionUp; } #region Methods called by regions in this instance @@ -541,11 +537,10 @@ namespace OpenSim.Region.Communications.OGS1 MainLog.Instance.Debug(e.ToString()); return false; } - return true; } // UGLY! - public bool RegionUp(RegionInfo region) + public bool RegionUp(SearializableRegionInfo region) { // This is stupid. For this to work, when the region registers it must request nearby map blocks. @@ -558,11 +553,11 @@ namespace OpenSim.Region.Communications.OGS1 { return true; } - return true; + foreach (SimpleRegionInfo knownregion in m_knownRegions) { - // Wha? - RegionInfo regInfo = RequestNeighbourInfo(knownregion.RegionID); + + SearializableRegionInfo regInfo = new SearializableRegionInfo(RequestNeighbourInfo(knownregion.RegionID)); try { @@ -572,7 +567,7 @@ namespace OpenSim.Region.Communications.OGS1 //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 + @@ -588,38 +583,38 @@ namespace OpenSim.Region.Communications.OGS1 Console.WriteLine("remoting object not found"); } remObject = null; - //MainLog.Instance.Verbose("INTER", gdebugRegionName + ": OGS1 tried to NotifyRegionUp for " + region.RegionName + " and got " + retValue.ToString()); + MainLog.Instance.Verbose("INTER", gdebugRegionName + ": OGS1 tried to NotifyRegionUp for " + regInfo.RegionLocX + "," + regInfo.RegionLocY); } } catch (RemotingException e) { - MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); + MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionLocX + "," + regInfo.RegionLocY); MainLog.Instance.Debug(e.ToString()); //return false; } catch (SocketException e) { - MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); + MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionLocX + "," + regInfo.RegionLocY); MainLog.Instance.Debug(e.ToString()); //return false; } catch (InvalidCredentialException e) { - MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); + MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionLocX + "," + regInfo.RegionLocY); MainLog.Instance.Debug(e.ToString()); //return false; } catch (AuthenticationException e) { - MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); + MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region: " + regInfo.RegionLocX + "," + regInfo.RegionLocY); MainLog.Instance.Debug(e.ToString()); //return false; } catch (Exception e) { - MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); + MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionLocX + "," + regInfo.RegionLocY); MainLog.Instance.Debug(e.ToString()); //return false; } @@ -702,7 +697,6 @@ namespace OpenSim.Region.Communications.OGS1 MainLog.Instance.Debug(e.ToString()); return false; } - return true; } /// /// @@ -843,13 +837,13 @@ namespace OpenSim.Region.Communications.OGS1 } } - public bool TriggerRegionUp(RegionInfo regionData) + public bool TriggerRegionUp(SearializableRegionInfo regionData) { - //MainLog.Instance.Verbose("INTER", gdebugRegionName + ": Incoming OGS1 RegionUpReport " + regionData.RegionName); + MainLog.Instance.Verbose("INTER", gdebugRegionName + ": Incoming OGS1 RegionUpReport: " + regionData.RegionLocX + "," + regionData.RegionLocY); try { - return m_localBackend.TriggerRegionUp(regionData); + return m_localBackend.TriggerRegionUp(new RegionInfo(regionData)); } catch (RemotingException e) diff --git a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs index aa6f59a..2f7e591 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs @@ -41,7 +41,7 @@ namespace OpenSim.Region.Communications.OGS1 public delegate bool PrimGroupArrival(ulong regionHandle, LLUUID primID, string objData); - public delegate bool RegionUP (RegionInfo region); + public delegate bool RegionUp (SearializableRegionInfo region); public sealed class InterRegionSingleton { @@ -76,11 +76,12 @@ namespace OpenSim.Region.Communications.OGS1 return false; } - public bool RegionUp(RegionInfo region) + public bool RegionUp(SearializableRegionInfo sregion) { + if (OnRegionUp != null) { - return OnRegionUp(region); + return OnRegionUp(sregion); } return false; } @@ -129,7 +130,7 @@ namespace OpenSim.Region.Communications.OGS1 return false; } } - public bool RegionUp(RegionInfo region) + public bool RegionUp(SearializableRegionInfo region) { try { @@ -141,6 +142,7 @@ namespace OpenSim.Region.Communications.OGS1 return false; } } + public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) { try -- cgit v1.1