From 33330297d603a66cc157baa21c81328edc893e51 Mon Sep 17 00:00:00 2001 From: diva Date: Fri, 20 Feb 2009 03:39:50 +0000 Subject: THE BIG ANTI-REMOTING SCHLEP -- StartRemoting is no more. Sims in older versions will have a hard time communicating with sims on this release and later, especially if they haven't transitioned to RESTComms at all. There's still some cleanup to do on assorted data structures, but the main functional change here is that sims no longer listen on remoting ports. --- .../Communications/Hypergrid/HGGridServices.cs | 330 +-------------------- 1 file changed, 1 insertion(+), 329 deletions(-) (limited to 'OpenSim/Region/Communications/Hypergrid/HGGridServices.cs') diff --git a/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs b/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs index 24db63e..08d74f3 100644 --- a/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs +++ b/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs @@ -55,7 +55,7 @@ namespace OpenSim.Region.Communications.Hypergrid /// hyperlinks, as well as processing all the inter-region comms between a region and /// an hyperlinked region. /// - public class HGGridServices : IGridServices, IInterRegionCommunications, IHyperlink + public class HGGridServices : IGridServices, IHyperlink { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -777,80 +777,6 @@ namespace OpenSim.Region.Communications.Hypergrid return resp; } - #region IInterRegionCommunications interface - - public virtual bool AcknowledgeAgentCrossed(ulong regionHandle, UUID agentId) { return false; } - public virtual bool AcknowledgePrimCrossed(ulong regionHandle, UUID primID) { return false; } - public virtual bool CheckRegion(string address, uint port) { return false; } - public virtual bool ChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData) { return false; } - - public virtual bool ExpectAvatarCrossing(ulong regionHandle, UUID agentID, Vector3 position, bool isFlying) { - // Remote region - RegionInfo regInfo = null; - ulong remoteHandle = 0; - try - { - regInfo = RequestNeighbourInfo(regionHandle); - if (regInfo != null) - { - try - { - remoteHandle = Convert.ToUInt64(regInfo.regionSecret); - } - catch - { - m_log.Warn("[HGrid]: Invalid remote region with handle " + regInfo.regionSecret); - return false; - } - //Console.WriteLine("XXX---- Sending Expectavatarcrossing into : " + remoteHandle); - - bool retValue = false; - OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject( - typeof(OGS1InterRegionRemoting), - "tcp://" + regInfo.RemotingAddress + - ":" + regInfo.RemotingPort + - "/InterRegions"); - - if (remObject != null) - { - retValue = - remObject.ExpectAvatarCrossing(remoteHandle, agentID.Guid, new sLLVector3(position), - isFlying); - } - else - { - m_log.Warn("[HGrid]: Remoting object not found"); - } - remObject = null; - - return retValue; - } - //TODO need to see if we know about where this region is and use .net remoting - // to inform it. - //NoteDeadRegion(regionHandle); - return false; - } - catch (RemotingException e) - { -// NoteDeadRegion(regionHandle); - - m_log.WarnFormat( - "[HGrid]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", - regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); - m_log.DebugFormat("[HGrid]: {0} {1}", e.Source, e.Message); - - return false; - } - catch - { -// NoteDeadRegion(regionHandle); - return false; - } - - } - - public virtual bool ExpectPrimCrossing(ulong regionHandle, UUID primID, Vector3 position, bool isFlying) { return false; } - public bool SendUserInformation(RegionInfo regInfo, AgentCircuitData agentData) { CachedUserInfo uinfo = m_userProfileCache.GetUserDetails(agentData.AgentID); @@ -887,260 +813,6 @@ namespace OpenSim.Region.Communications.Hypergrid return true; } - public virtual bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) - { - // If we're here, it's because regionHandle is a remote, non-grided region - m_log.Info("[HGrid]: InformRegionOfChildAgent for " + regionHandle); - - RegionInfo regInfo = GetHyperlinkRegion(regionHandle); - if (regInfo == null) - return false; - - //ulong realHandle = regionHandle; - - if (!SendUserInformation(regInfo, agentData)) - { - m_log.Warn("[HGrid]: Failed to inform remote region of user."); - //return false; - } - - try - { - // ... and then - - m_log.Debug("[HGrid]: Region is hyperlink."); - bool retValue = false; - try - { - regionHandle = Convert.ToUInt64(regInfo.regionSecret); - } - catch (Exception) - { - m_log.Warn("[HGrid]: Invalid hyperlink region."); - return false; - } - - OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject( - typeof(OGS1InterRegionRemoting), - "tcp://" + regInfo.RemotingAddress + - ":" + regInfo.RemotingPort + - "/InterRegions"); - - if (remObject != null) - { - sAgentCircuitData sag = new sAgentCircuitData(agentData); - //CachedUserInfo uinfo = m_userProfileCache.GetUserDetails(agentData.AgentID); - - //// May need to change agent's name - //if (IsLocalUser(uinfo)) - //{ - // sag.firstname = agentData.firstname + "." + agentData.lastname; - // sag.lastname = serversInfo.UserURL; //HGNetworkServersInfo.Singleton.LocalUserServerURI; - //} - retValue = remObject.InformRegionOfChildAgent(regionHandle, sag); - } - else - { - m_log.Warn("[HGrid]: remoting object not found"); - } - remObject = null; - m_log.Info("[HGrid]: tried to InformRegionOfChildAgent for " + - agentData.firstname + " " + agentData.lastname + " and got " + - retValue.ToString()); - - // Remove the info from this region - //if (m_knownRegions.ContainsKey(uinfo.UserProfile.ID)) - // m_knownRegions.Remove(uinfo.UserProfile.ID); - - return retValue; - } - catch (RemotingException e) - { - //NoteDeadRegion(regionHandle); - - m_log.WarnFormat( - "[HGrid]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", - regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); - m_log.DebugFormat("[HGrid]: {0} {1}", e.Source, e.Message); - - return false; - } - catch (SocketException e) - { - //NoteDeadRegion(regionHandle); - - m_log.WarnFormat( - "[HGrid]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", - regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); - m_log.DebugFormat("[HGrid]: {0} {1}", e.Source, e.Message); - - return false; - } - catch (InvalidCredentialException e) - { - //NoteDeadRegion(regionHandle); - - m_log.WarnFormat( - "[HGrid]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", - regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); - m_log.DebugFormat("[HGrid]: {0} {1}", e.Source, e.Message); - - return false; - } - catch (AuthenticationException e) - { - //NoteDeadRegion(regionHandle); - - m_log.WarnFormat( - "[HGrid]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", - regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); - m_log.DebugFormat("[HGrid]: {0} {1}", e.Source, e.Message); - - return false; - } - catch (Exception e) - { - //NoteDeadRegion(regionHandle); - - if (regInfo != null) - { - m_log.WarnFormat( - "[HGrid]: Remoting Error: Unable to connect to adjacent region: {0} {1},{2}", - regInfo.RegionName, regInfo.RegionLocX, regInfo.RegionLocY); - } - m_log.DebugFormat("[HGrid]: {0} {1}", e.Source, e.Message); - - return false; - } - - - } - - public virtual bool InformRegionOfPrimCrossing(ulong regionHandle, UUID primID, string objData, int XMLMethod) { return false; } - - public virtual bool RegionUp(SerializableRegionInfo region, ulong regionhandle) { - - ulong realHandle = FindRegionHandle(regionhandle); - - if (realHandle == regionhandle) // something wrong, not remote region - return false; - - SerializableRegionInfo regInfo = null; - try - { - // You may ask why this is in here... - // The region asking the grid services about itself.. - // And, surprisingly, the reason is.. it doesn't know - // it's own remoting port! How special. - RegionUpData regiondata = new RegionUpData(region.RegionLocX, region.RegionLocY, region.ExternalHostName, region.InternalEndPoint.Port); - - region = new SerializableRegionInfo(RequestNeighbourInfo(realHandle)); - region.RemotingAddress = region.ExternalHostName; - region.RemotingPort = NetworkServersInfo.RemotingListenerPort; - region.HttpPort = serversInfo.HttpListenerPort; - - regInfo = new SerializableRegionInfo(RequestNeighbourInfo(regionhandle)); - if (regInfo != null) - { - // If we're not trying to remote to ourselves. - if (regInfo.RemotingAddress != region.RemotingAddress && region.RemotingAddress != 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(regiondata, realHandle); - } - else - { - m_log.Warn("[HGrid]: remoting object not found"); - } - remObject = null; - - m_log.Info( - "[HGrid]: tried to inform region I'm up"); - - return retValue; - } - else - { - // We're trying to inform ourselves via remoting. - // This is here because we're looping over the listeners before we get here. - // Odd but it should work. - return true; - } - } - - return false; - } - catch (RemotingException e) - { - m_log.Warn("[HGrid]: Remoting Error: Unable to connect to adjacent region using tcp://" + - regInfo.RemotingAddress + - ":" + regInfo.RemotingPort + - "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY + - " - Is this neighbor up?"); - m_log.DebugFormat("[HGrid]: {0} {1}", e.Source, e.Message); - return false; - } - catch (SocketException e) - { - m_log.Warn("[HGrid]: Socket Error: Unable to connect to adjacent region using tcp://" + - regInfo.RemotingAddress + - ":" + regInfo.RemotingPort + - "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY + - " - Is this neighbor up?"); - m_log.DebugFormat("[HGrid]: {0} {1}", e.Source, e.Message); - return false; - } - catch (InvalidCredentialException e) - { - m_log.Warn("[HGrid]: Invalid Credentials: Unable to connect to adjacent region using tcp://" + - regInfo.RemotingAddress + - ":" + regInfo.RemotingPort + - "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - m_log.DebugFormat("[HGrid]: {0} {1}", e.Source, e.Message); - return false; - } - catch (AuthenticationException e) - { - m_log.Warn("[HGrid]: Authentication exception: Unable to connect to adjacent region using tcp://" + - regInfo.RemotingAddress + - ":" + regInfo.RemotingPort + - "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY); - m_log.DebugFormat("[HGrid]: {0} {1}", e.Source, e.Message); - return false; - } - catch (Exception e) - { - m_log.Debug(e.ToString()); - return false; - } - - } - - public virtual bool TellRegionToCloseChildConnection(ulong regionHandle, UUID agentID) { return false; } - - public virtual List InformFriendsInOtherRegion(UUID agentId, ulong destRegionHandle, List friends, bool online) - { - return new List(); - } - - public virtual bool TriggerTerminateFriend(ulong regionHandle, UUID agentID, UUID exFriendID) - { - return true; - } - - - #endregion #region Methods triggered by calls from external instances -- cgit v1.1