diff options
Extra check to avoid client crashes on HG home teleports.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Hypergrid/HGScene.cs | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Hypergrid/HGScene.cs b/OpenSim/Region/Environment/Scenes/Hypergrid/HGScene.cs index da1d3a7..ca644a6 100644 --- a/OpenSim/Region/Environment/Scenes/Hypergrid/HGScene.cs +++ b/OpenSim/Region/Environment/Scenes/Hypergrid/HGScene.cs | |||
@@ -52,26 +52,32 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid | |||
52 | m_log.Debug("[HGScene]: TeleportClientHome " + client.FirstName + " " + client.LastName); | 52 | m_log.Debug("[HGScene]: TeleportClientHome " + client.FirstName + " " + client.LastName); |
53 | 53 | ||
54 | CachedUserInfo uinfo = CommsManager.UserProfileCacheService.GetUserDetails(agentId); | 54 | CachedUserInfo uinfo = CommsManager.UserProfileCacheService.GetUserDetails(agentId); |
55 | UserProfileData UserProfile = uinfo.UserProfile; | 55 | if (uinfo != null) |
56 | |||
57 | if (UserProfile != null) | ||
58 | { | 56 | { |
59 | RegionInfo regionInfo = CommsManager.GridService.RequestNeighbourInfo(UserProfile.HomeRegion); | 57 | UserProfileData UserProfile = uinfo.UserProfile; |
58 | |||
59 | if (UserProfile != null) | ||
60 | { | ||
61 | RegionInfo regionInfo = CommsManager.GridService.RequestNeighbourInfo(UserProfile.HomeRegion); | ||
60 | //if (regionInfo != null) | 62 | //if (regionInfo != null) |
61 | //{ | 63 | //{ |
62 | // UserProfile.HomeRegionID = regionInfo.RegionID; | 64 | // UserProfile.HomeRegionID = regionInfo.RegionID; |
63 | // //CommsManager.UserService.UpdateUserProfile(UserProfile); | 65 | // //CommsManager.UserService.UpdateUserProfile(UserProfile); |
64 | //} | 66 | //} |
65 | if (regionInfo == null) | 67 | if (regionInfo == null) |
66 | { | 68 | { |
67 | // can't find the Home region: Tell viewer and abort | 69 | // can't find the Home region: Tell viewer and abort |
68 | client.SendTeleportFailed("Your home-region could not be found."); | 70 | client.SendTeleportFailed("Your home-region could not be found."); |
69 | return; | 71 | return; |
72 | } | ||
73 | RequestTeleportLocation( | ||
74 | client, regionInfo.RegionHandle, UserProfile.HomeLocation, UserProfile.HomeLookAt, | ||
75 | (uint)(TPFlags.SetLastToTarget | TPFlags.ViaHome)); | ||
70 | } | 76 | } |
71 | RequestTeleportLocation( | ||
72 | client, regionInfo.RegionHandle, UserProfile.HomeLocation, UserProfile.HomeLookAt, | ||
73 | (uint)(TPFlags.SetLastToTarget | TPFlags.ViaHome)); | ||
74 | } | 77 | } |
78 | else | ||
79 | client.SendTeleportFailed("Sorry! I lost your home-region information."); | ||
80 | |||
75 | } | 81 | } |
76 | 82 | ||
77 | } | 83 | } |