From 175b6115f19f9bad7c81fde625250b3a7f8a33f2 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Mon, 26 Nov 2007 05:02:18 +0000 Subject: * Restarting regions with the estate tools works in sandbox mode. I'm still working on grid mode, however. It doesn't break anything, but that feature doesn't work in grid mode yet either. --- .../Region/Communications/OGS1/OGS1GridServices.cs | 90 ++++++++++++++++++++++ 1 file changed, 90 insertions(+) (limited to 'OpenSim/Region/Communications/OGS1/OGS1GridServices.cs') diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 6b2407a..a0d6bd3 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -380,6 +380,7 @@ namespace OpenSim.Region.Communications.OGS1 InterRegionSingleton.Instance.OnChildAgent += IncomingChildAgent; InterRegionSingleton.Instance.OnPrimGroupArrival += IncomingPrim; InterRegionSingleton.Instance.OnPrimGroupNear += TriggerExpectPrimCrossing; + InterRegionSingleton.Instance.OnRegionUp += TriggerRegionUp; } @@ -465,6 +466,81 @@ namespace OpenSim.Region.Communications.OGS1 } return true; } + + // UGLY! + public bool RegionUp(RegionInfo region) + { + RegionInfo regInfo = null; + try + { + if (m_localBackend.RegionUp(region)) + { + return true; + } + foreach (RegionInfo remoteInfo in m_remoteRegionInfoCache.Values) + { + regInfo = RequestNeighbourInfo(remoteInfo.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.RegionUp(region); + } + else + { + Console.WriteLine("remoting object not found"); + } + remObject = null; + + } + + } + + + return true; + } + catch (RemotingException e) + { + MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " + 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.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.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.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.Debug(e.ToString()); + return false; + } + return true; + } /// /// /// @@ -680,6 +756,20 @@ namespace OpenSim.Region.Communications.OGS1 } } + public bool TriggerRegionUp(RegionInfo regionData) + { + try + { + return m_localBackend.TriggerRegionUp(regionData); + } + + catch (RemotingException e) + { + MainLog.Instance.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString()); + return false; + } + } + /// /// /// -- cgit v1.1