From dd2a82f81c893a202b906a41b5ad6318d88cdfd3 Mon Sep 17 00:00:00 2001 From: diva Date: Sat, 3 Jan 2009 08:51:54 +0000 Subject: Extra check to avoid client crashes on HG home teleports. --- .../Region/Environment/Scenes/Hypergrid/HGScene.cs | 30 +++++++++++++--------- 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'OpenSim') 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 m_log.Debug("[HGScene]: TeleportClientHome " + client.FirstName + " " + client.LastName); CachedUserInfo uinfo = CommsManager.UserProfileCacheService.GetUserDetails(agentId); - UserProfileData UserProfile = uinfo.UserProfile; - - if (UserProfile != null) + if (uinfo != null) { - RegionInfo regionInfo = CommsManager.GridService.RequestNeighbourInfo(UserProfile.HomeRegion); + UserProfileData UserProfile = uinfo.UserProfile; + + if (UserProfile != null) + { + RegionInfo regionInfo = CommsManager.GridService.RequestNeighbourInfo(UserProfile.HomeRegion); //if (regionInfo != null) //{ // UserProfile.HomeRegionID = regionInfo.RegionID; // //CommsManager.UserService.UpdateUserProfile(UserProfile); //} - if (regionInfo == null) - { - // can't find the Home region: Tell viewer and abort - client.SendTeleportFailed("Your home-region could not be found."); - return; + if (regionInfo == null) + { + // can't find the Home region: Tell viewer and abort + client.SendTeleportFailed("Your home-region could not be found."); + return; + } + RequestTeleportLocation( + client, regionInfo.RegionHandle, UserProfile.HomeLocation, UserProfile.HomeLookAt, + (uint)(TPFlags.SetLastToTarget | TPFlags.ViaHome)); } - RequestTeleportLocation( - client, regionInfo.RegionHandle, UserProfile.HomeLocation, UserProfile.HomeLookAt, - (uint)(TPFlags.SetLastToTarget | TPFlags.ViaHome)); } + else + client.SendTeleportFailed("Sorry! I lost your home-region information."); + } } -- cgit v1.1