diff options
author | Charles Krinke | 2008-08-16 19:34:12 +0000 |
---|---|---|
committer | Charles Krinke | 2008-08-16 19:34:12 +0000 |
commit | b6c6572ee1f162207f072c1c5e3a5c5355aba620 (patch) | |
tree | 7979dd37d8a099ba66e325e4e9a4f4a5c96cd656 /OpenSim/Region | |
parent | Mantis#1965. Thank you kindly, HomerHorwitz for a patch that: (diff) | |
download | opensim-SC-b6c6572ee1f162207f072c1c5e3a5c5355aba620.zip opensim-SC-b6c6572ee1f162207f072c1c5e3a5c5355aba620.tar.gz opensim-SC-b6c6572ee1f162207f072c1c5e3a5c5355aba620.tar.bz2 opensim-SC-b6c6572ee1f162207f072c1c5e3a5c5355aba620.tar.xz |
Mantis#1969. Thank you kindly, Tyre for a patch that:
Type casting the normalized vector 'lookat' to int results to <0,0,0>.
This patch also adds an overload to RequestNeighbourInfo (currently unused)
that will come handy for some features I'm working on.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 9b0b53a..cb32680 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -2178,14 +2178,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
2178 | // EventManager.TriggerOnNewClient(client); | 2178 | // EventManager.TriggerOnNewClient(client); |
2179 | } | 2179 | } |
2180 | 2180 | ||
2181 | public virtual void TeleportClientHome(LLUUID AgentId, IClientAPI client) | 2181 | public virtual void TeleportClientHome(LLUUID agentId, IClientAPI client) |
2182 | { | 2182 | { |
2183 | UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(AgentId); | 2183 | UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(agentId); |
2184 | if (UserProfile != null) | 2184 | if (UserProfile != null) |
2185 | { | 2185 | { |
2186 | LLUUID homeRegionID = UserProfile.HomeRegionID; | 2186 | LLUUID homeRegionID = UserProfile.HomeRegionID; |
2187 | LLVector3 homePostion = new LLVector3(UserProfile.HomeLocationX,UserProfile.HomeLocationY,UserProfile.HomeLocationZ); | ||
2188 | LLVector3 homeLookat = new LLVector3(UserProfile.HomeLookAt); | ||
2189 | ulong homeRegionHandle = UserProfile.HomeRegion; | 2187 | ulong homeRegionHandle = UserProfile.HomeRegion; |
2190 | if (homeRegionID == LLUUID.Zero) | 2188 | if (homeRegionID == LLUUID.Zero) |
2191 | { | 2189 | { |
@@ -2210,7 +2208,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
2210 | } | 2208 | } |
2211 | homeRegionHandle = info.RegionHandle; | 2209 | homeRegionHandle = info.RegionHandle; |
2212 | } | 2210 | } |
2213 | RequestTeleportLocation(client, homeRegionHandle, homePostion,homeLookat,(uint)0); | 2211 | RequestTeleportLocation(client, homeRegionHandle, UserProfile.HomeLocation, UserProfile.HomeLookAt, (uint)0); |
2214 | } | 2212 | } |
2215 | } | 2213 | } |
2216 | 2214 | ||
@@ -2296,16 +2294,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
2296 | // TODO: The next line can be removed, as soon as only homeRegionID based UserServers are around. | 2294 | // TODO: The next line can be removed, as soon as only homeRegionID based UserServers are around. |
2297 | // TODO: The HomeRegion property can be removed then, too | 2295 | // TODO: The HomeRegion property can be removed then, too |
2298 | UserProfile.HomeRegion = RegionInfo.RegionHandle; | 2296 | UserProfile.HomeRegion = RegionInfo.RegionHandle; |
2299 | 2297 | UserProfile.HomeLocation = position; | |
2300 | // We cast these to an int so as not to cause a breaking change with old regions | 2298 | UserProfile.HomeLookAt = lookAt; |
2301 | // Newer regions treat this as a float on the ExpectUser method.. so we need to wait a few | ||
2302 | // releases before setting these to floats. (r4257) | ||
2303 | UserProfile.HomeLocationX = (int)position.X; | ||
2304 | UserProfile.HomeLocationY = (int)position.Y; | ||
2305 | UserProfile.HomeLocationZ = (int)position.Z; | ||
2306 | UserProfile.HomeLookAtX = (int)lookAt.X; | ||
2307 | UserProfile.HomeLookAtY = (int)lookAt.Y; | ||
2308 | UserProfile.HomeLookAtZ = (int)lookAt.Z; | ||
2309 | CommsManager.UserService.UpdateUserProfileProperties(UserProfile); | 2299 | CommsManager.UserService.UpdateUserProfileProperties(UserProfile); |
2310 | 2300 | ||
2311 | remoteClient.SendAgentAlertMessage("Set home to here if supported by login service",false); | 2301 | remoteClient.SendAgentAlertMessage("Set home to here if supported by login service",false); |
@@ -2803,6 +2793,27 @@ namespace OpenSim.Region.Environment.Scenes | |||
2803 | /// Tries to teleport agent to other region. | 2793 | /// Tries to teleport agent to other region. |
2804 | /// </summary> | 2794 | /// </summary> |
2805 | /// <param name="remoteClient"></param> | 2795 | /// <param name="remoteClient"></param> |
2796 | /// <param name="regionName"></param> | ||
2797 | /// <param name="position"></param> | ||
2798 | /// <param name="lookAt"></param> | ||
2799 | /// <param name="flags"></param> | ||
2800 | public void RequestTeleportLocation(IClientAPI remoteClient, string regionName, LLVector3 position, | ||
2801 | LLVector3 lookat, uint flags) | ||
2802 | { | ||
2803 | RegionInfo regionInfo = m_sceneGridService.RequestClosestRegion(regionName); | ||
2804 | if (regionInfo == null) | ||
2805 | { | ||
2806 | // can't find the region: Tell viewer and abort | ||
2807 | remoteClient.SendTeleportFailed("The region '" + regionName + "' could not be found."); | ||
2808 | return; | ||
2809 | } | ||
2810 | RequestTeleportLocation(remoteClient, regionInfo.RegionHandle, position, lookat, flags); | ||
2811 | } | ||
2812 | |||
2813 | /// <summary> | ||
2814 | /// Tries to teleport agent to other region. | ||
2815 | /// </summary> | ||
2816 | /// <param name="remoteClient"></param> | ||
2806 | /// <param name="regionHandle"></param> | 2817 | /// <param name="regionHandle"></param> |
2807 | /// <param name="position"></param> | 2818 | /// <param name="position"></param> |
2808 | /// <param name="lookAt"></param> | 2819 | /// <param name="lookAt"></param> |