aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
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
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')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs39
2 files changed, 33 insertions, 12 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 44f1191..ee6cb04 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -97,7 +97,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
97 scene.EventManager.OnNewClient += OnNewClient; 97 scene.EventManager.OnNewClient += OnNewClient;
98 } 98 }
99 99
100 protected void OnNewClient(IClientAPI client) 100 protected virtual void OnNewClient(IClientAPI client)
101 { 101 {
102 client.OnTeleportHomeRequest += TeleportHome; 102 client.OnTeleportHomeRequest += TeleportHome;
103 } 103 }
@@ -268,6 +268,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
268 if (sp.ParentID != (uint)0) 268 if (sp.ParentID != (uint)0)
269 sp.StandUp(); 269 sp.StandUp();
270 270
271 m_log.Debug("XXX HERE 1");
271 if (!sp.ValidateAttachments()) 272 if (!sp.ValidateAttachments())
272 { 273 {
273 sp.ControllingClient.SendTeleportFailed("Inconsistent attachment state"); 274 sp.ControllingClient.SendTeleportFailed("Inconsistent attachment state");
@@ -978,12 +979,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
978 if (neighbour.RegionHandle != sp.Scene.RegionInfo.RegionHandle) 979 if (neighbour.RegionHandle != sp.Scene.RegionInfo.RegionHandle)
979 { 980 {
980 981
982 AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
981 AgentCircuitData agent = sp.ControllingClient.RequestClientInfo(); 983 AgentCircuitData agent = sp.ControllingClient.RequestClientInfo();
982 agent.BaseFolder = UUID.Zero; 984 agent.BaseFolder = UUID.Zero;
983 agent.InventoryFolder = UUID.Zero; 985 agent.InventoryFolder = UUID.Zero;
984 agent.startpos = new Vector3(128, 128, 70); 986 agent.startpos = new Vector3(128, 128, 70);
985 agent.child = true; 987 agent.child = true;
986 agent.Appearance = sp.Appearance; 988 agent.Appearance = sp.Appearance;
989 if (currentAgentCircuit != null)
990 agent.ServiceURLs = currentAgentCircuit.ServiceURLs;
987 991
988 if (newRegions.Contains(neighbour.RegionHandle)) 992 if (newRegions.Contains(neighbour.RegionHandle))
989 { 993 {
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"))