aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
diff options
context:
space:
mode:
authorDiva Canto2010-01-29 09:12:22 -0800
committerDiva Canto2010-01-29 09:12:22 -0800
commit0c81966c0a8f69474fb542d7b4df1780ef756519 (patch)
tree549973fd8c11ee8dd3eba939eb0605a28c6d2849 /OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
parentFixed broken dll name. (diff)
downloadopensim-SC_OLD-0c81966c0a8f69474fb542d7b4df1780ef756519.zip
opensim-SC_OLD-0c81966c0a8f69474fb542d7b4df1780ef756519.tar.gz
opensim-SC_OLD-0c81966c0a8f69474fb542d7b4df1780ef756519.tar.bz2
opensim-SC_OLD-0c81966c0a8f69474fb542d7b4df1780ef756519.tar.xz
Works for grid login.
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs39
1 files changed, 28 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index 85c2742..fbf8be9 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -85,8 +85,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
85 } 85 }
86 } 86 }
87 87
88 void OnNewClient(IClientAPI client) 88 protected override void OnNewClient(IClientAPI client)
89 { 89 {
90 base.OnNewClient(client);
90 client.OnLogout += new Action<IClientAPI>(OnLogout); 91 client.OnLogout += new Action<IClientAPI>(OnLogout);
91 } 92 }
92 93
@@ -118,7 +119,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
118 protected override GridRegion GetFinalDestination(GridRegion region) 119 protected override GridRegion GetFinalDestination(GridRegion region)
119 { 120 {
120 int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, region.RegionID); 121 int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, region.RegionID);
121 //m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: region {0} flags: {1}", region.RegionID, flags); 122 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: region {0} flags: {1}", region.RegionID, flags);
122 if ((flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) 123 if ((flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0)
123 { 124 {
124 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region {0} is hyperlink", region.RegionID); 125 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region {0} is hyperlink", region.RegionID);
@@ -129,7 +130,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
129 130
130 protected override bool NeedsClosing(uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, GridRegion reg) 131 protected override bool NeedsClosing(uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, GridRegion reg)
131 { 132 {
132 return true; 133 if (base.NeedsClosing(oldRegionX, newRegionX, oldRegionY, newRegionY, reg))
134 return true;
135
136 int flags = m_aScene.GridService.GetRegionFlags(m_aScene.RegionInfo.ScopeID, reg.RegionID);
137 if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0)
138 return true;
139
140 return false;
133 } 141 }
134 142
135 protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason) 143 protected override bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason)
@@ -139,14 +147,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
139 if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0) 147 if (flags == -1 /* no region in DB */ || (flags & (int)OpenSim.Data.RegionFlags.Hyperlink) != 0)
140 { 148 {
141 // this user is going to another grid 149 // this user is going to another grid
142 string userAgentDriver = agentCircuit.ServiceURLs["HomeURI"].ToString(); 150 if (agentCircuit.ServiceURLs.ContainsKey("HomeURI"))
143 IUserAgentService connector = new UserAgentServiceConnector(userAgentDriver); 151 {
144 bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, out reason); 152 string userAgentDriver = agentCircuit.ServiceURLs["HomeURI"].ToString();
145 if (success) 153 IUserAgentService connector = new UserAgentServiceConnector(userAgentDriver);
146 // Log them out of this grid 154 bool success = connector.LoginAgentToGrid(agentCircuit, reg, finalDestination, out reason);
147 m_aScene.PresenceService.LogoutAgent(agentCircuit.SessionID, sp.AbsolutePosition, sp.Lookat); 155 if (success)
148 156 // Log them out of this grid
149 return success; 157 m_aScene.PresenceService.LogoutAgent(agentCircuit.SessionID, sp.AbsolutePosition, sp.Lookat);
158
159 return success;
160 }
161 else
162 {
163 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Agent does not have a HomeURI address");
164 return false;
165 }
150 } 166 }
151 167
152 return m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason); 168 return m_aScene.SimulationService.CreateAgent(reg, agentCircuit, teleportFlags, out reason);
@@ -220,6 +236,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
220 236
221 void OnLogout(IClientAPI obj) 237 void OnLogout(IClientAPI obj)
222 { 238 {
239 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: client {0} logged out in {1}", obj.AgentId, obj.Scene.RegionInfo.RegionName);
223 AgentCircuitData aCircuit = ((Scene)(obj.Scene)).AuthenticateHandler.GetAgentCircuitData(obj.CircuitCode); 240 AgentCircuitData aCircuit = ((Scene)(obj.Scene)).AuthenticateHandler.GetAgentCircuitData(obj.CircuitCode);
224 241
225 if (aCircuit.ServiceURLs.ContainsKey("HomeURI")) 242 if (aCircuit.ServiceURLs.ContainsKey("HomeURI"))