diff options
author | lbsa71 | 2009-02-07 20:16:58 +0000 |
---|---|---|
committer | lbsa71 | 2009-02-07 20:16:58 +0000 |
commit | 262acf61c469cfd746958630c8842ab688118f09 (patch) | |
tree | 4b8fa7abe7e447cff89282cb494b58dd779339c2 /OpenSim/Region/Communications/Local/LocalLoginService.cs | |
parent | Thank you kindly, TLaukkan (Tommil) for a patch that: (diff) | |
download | opensim-SC_OLD-262acf61c469cfd746958630c8842ab688118f09.zip opensim-SC_OLD-262acf61c469cfd746958630c8842ab688118f09.tar.gz opensim-SC_OLD-262acf61c469cfd746958630c8842ab688118f09.tar.bz2 opensim-SC_OLD-262acf61c469cfd746958630c8842ab688118f09.tar.xz |
* Refactored UserLoginService.CustomiseResponse to be (almost) text-wide identical to LocalLoginService.CustomiseResponse in order to be able to pull them up.
Diffstat (limited to 'OpenSim/Region/Communications/Local/LocalLoginService.cs')
-rw-r--r-- | OpenSim/Region/Communications/Local/LocalLoginService.cs | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index 159773b..5cd587d 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs | |||
@@ -145,10 +145,17 @@ namespace OpenSim.Region.Communications.Local | |||
145 | RegionInfo homeInfo = null; | 145 | RegionInfo homeInfo = null; |
146 | 146 | ||
147 | // use the homeRegionID if it is stored already. If not, use the regionHandle as before | 147 | // use the homeRegionID if it is stored already. If not, use the regionHandle as before |
148 | if (theUser.HomeRegionID != UUID.Zero) | 148 | UUID homeRegionId = theUser.HomeRegionID; |
149 | homeInfo = m_gridService.RequestNeighbourInfo(theUser.HomeRegionID); | 149 | ulong homeRegionHandle = theUser.HomeRegion; |
150 | if (homeRegionId != UUID.Zero) | ||
151 | { | ||
152 | homeInfo = GetRegionInfo(homeRegionId); | ||
153 | } | ||
150 | else | 154 | else |
151 | homeInfo = m_gridService.RequestNeighbourInfo(theUser.HomeRegion); | 155 | { |
156 | homeInfo = GetRegionInfo(homeRegionHandle); | ||
157 | } | ||
158 | |||
152 | if (homeInfo != null) | 159 | if (homeInfo != null) |
153 | { | 160 | { |
154 | response.Home = | 161 | response.Home = |
@@ -164,8 +171,8 @@ namespace OpenSim.Region.Communications.Local | |||
164 | // Emergency mode: Home-region isn't available, so we can't request the region info. | 171 | // Emergency mode: Home-region isn't available, so we can't request the region info. |
165 | // Use the stored home regionHandle instead. | 172 | // Use the stored home regionHandle instead. |
166 | // NOTE: If the home-region moves, this will be wrong until the users update their user-profile again | 173 | // NOTE: If the home-region moves, this will be wrong until the users update their user-profile again |
167 | ulong regionX = theUser.HomeRegion >> 32; | 174 | ulong regionX = homeRegionHandle >> 32; |
168 | ulong regionY = theUser.HomeRegion & 0xffffffff; | 175 | ulong regionY = homeRegionHandle & 0xffffffff; |
169 | response.Home = | 176 | response.Home = |
170 | string.Format( | 177 | string.Format( |
171 | "{{'region_handle':[r{0},r{1}], 'position':[r{2},r{3},r{4}], 'look_at':[r{5},r{6},r{7}]}}", | 178 | "{{'region_handle':[r{0},r{1}], 'position':[r{2},r{3},r{4}], 'look_at':[r{5},r{6},r{7}]}}", |
@@ -188,7 +195,8 @@ namespace OpenSim.Region.Communications.Local | |||
188 | } | 195 | } |
189 | else if (startLocationRequest == "last") | 196 | else if (startLocationRequest == "last") |
190 | { | 197 | { |
191 | regionInfo = m_gridService.RequestNeighbourInfo(theUser.CurrentAgent.Region); | 198 | UUID lastRegion = theUser.CurrentAgent.Region; |
199 | regionInfo = GetRegionInfo(lastRegion); | ||
192 | response.LookAt = "[r" + theUser.CurrentAgent.LookAt.X.ToString() + ",r" + theUser.CurrentAgent.LookAt.Y.ToString() + ",r" + theUser.CurrentAgent.LookAt.Z.ToString() + "]"; | 200 | response.LookAt = "[r" + theUser.CurrentAgent.LookAt.X.ToString() + ",r" + theUser.CurrentAgent.LookAt.Y.ToString() + ",r" + theUser.CurrentAgent.LookAt.Z.ToString() + "]"; |
193 | } | 201 | } |
194 | else | 202 | else |
@@ -202,7 +210,7 @@ namespace OpenSim.Region.Communications.Local | |||
202 | else | 210 | else |
203 | { | 211 | { |
204 | string region = uriMatch.Groups["region"].ToString(); | 212 | string region = uriMatch.Groups["region"].ToString(); |
205 | regionInfo = m_gridService.RequestClosestRegion(region); | 213 | regionInfo = RequestClosestRegion(region); |
206 | if (regionInfo == null) | 214 | if (regionInfo == null) |
207 | { | 215 | { |
208 | m_log.InfoFormat("[LOGIN]: Got Custom Login URL {0}, can't locate region {1}", startLocationRequest, region); | 216 | m_log.InfoFormat("[LOGIN]: Got Custom Login URL {0}, can't locate region {1}", startLocationRequest, region); |
@@ -238,7 +246,7 @@ namespace OpenSim.Region.Communications.Local | |||
238 | } | 246 | } |
239 | 247 | ||
240 | m_log.Error("[LOGIN]: Sending user to default region " + defaultHandle + " instead"); | 248 | m_log.Error("[LOGIN]: Sending user to default region " + defaultHandle + " instead"); |
241 | regionInfo = m_gridService.RequestNeighbourInfo(defaultHandle); | 249 | regionInfo = GetRegionInfo(defaultHandle); |
242 | 250 | ||
243 | // Customise the response | 251 | // Customise the response |
244 | //response.Home = | 252 | //response.Home = |
@@ -254,6 +262,21 @@ namespace OpenSim.Region.Communications.Local | |||
254 | return PrepareLoginToRegion(regionInfo, theUser, response); | 262 | return PrepareLoginToRegion(regionInfo, theUser, response); |
255 | } | 263 | } |
256 | 264 | ||
265 | protected RegionInfo RequestClosestRegion(string region) | ||
266 | { | ||
267 | return m_gridService.RequestClosestRegion(region); | ||
268 | } | ||
269 | |||
270 | protected RegionInfo GetRegionInfo(ulong homeRegionHandle) | ||
271 | { | ||
272 | return m_gridService.RequestNeighbourInfo(homeRegionHandle); | ||
273 | } | ||
274 | |||
275 | protected RegionInfo GetRegionInfo(UUID homeRegionId) | ||
276 | { | ||
277 | return m_gridService.RequestNeighbourInfo(homeRegionId); | ||
278 | } | ||
279 | |||
257 | /// <summary> | 280 | /// <summary> |
258 | /// Add active gestures of the user to the login response. | 281 | /// Add active gestures of the user to the login response. |
259 | /// </summary> | 282 | /// </summary> |