From b63405c1a796b44b58081857d01f726372467628 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 8 Jan 2010 10:43:34 -0800 Subject: Inching ahead... This compiles, but very likely does not run. --- OpenSim/Region/Framework/Scenes/Scene.cs | 57 +++++++--------------- .../Framework/Scenes/SceneCommunicationService.cs | 5 -- 2 files changed, 18 insertions(+), 44 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index d8874b2..e22dd2d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -296,6 +296,17 @@ namespace OpenSim.Region.Framework.Scenes } } + protected OpenSim.Services.Interfaces.IAvatarService m_AvatarService; + public OpenSim.Services.Interfaces.IAvatarService AvatarService + { + get + { + if (m_AvatarService == null) + m_AvatarService = RequestModuleInterface(); + return m_AvatarService; + } + } + protected IXMLRPC m_xmlrpcModule; protected IWorldComm m_worldCommModule; protected IAvatarFactory m_AvatarFactory; @@ -2975,21 +2986,11 @@ namespace OpenSim.Region.Framework.Scenes /// The IClientAPI for the client public virtual void TeleportClientHome(UUID agentId, IClientAPI client) { - UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(agentId); - if (UserProfile != null) + OpenSim.Services.Interfaces.PresenceInfo pinfo = PresenceService.GetAgent(client.SessionId); + + if (pinfo != null) { - GridRegion regionInfo = GridService.GetRegionByUUID(UUID.Zero, UserProfile.HomeRegionID); - if (regionInfo == null) - { - uint x = 0, y = 0; - Utils.LongToUInts(UserProfile.HomeRegion, out x, out y); - regionInfo = GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); - if (regionInfo != null) // home region can be away temporarily, too - { - UserProfile.HomeRegionID = regionInfo.RegionID; - CommsManager.UserService.UpdateUserProfile(UserProfile); - } - } + GridRegion regionInfo = GridService.GetRegionByUUID(UUID.Zero, pinfo.HomeRegionID); if (regionInfo == null) { // can't find the Home region: Tell viewer and abort @@ -2997,7 +2998,7 @@ namespace OpenSim.Region.Framework.Scenes return; } RequestTeleportLocation( - client, regionInfo.RegionHandle, UserProfile.HomeLocation, UserProfile.HomeLookAt, + client, regionInfo.RegionHandle, pinfo.HomePosition, pinfo.HomeLookAt, (uint)(TPFlags.SetLastToTarget | TPFlags.ViaHome)); } } @@ -3089,7 +3090,7 @@ namespace OpenSim.Region.Framework.Scenes } /// - /// Sets the Home Point. The GridService uses this to know where to put a user when they log-in + /// Sets the Home Point. The LoginService uses this to know where to put a user when they log-in /// /// /// @@ -3098,27 +3099,11 @@ namespace OpenSim.Region.Framework.Scenes /// public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags) { - UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(remoteClient.AgentId); - if (UserProfile != null) - { - // I know I'm ignoring the regionHandle provided by the teleport location request. - // reusing the TeleportLocationRequest delegate, so regionHandle isn't valid - UserProfile.HomeRegionID = RegionInfo.RegionID; - // TODO: The next line can be removed, as soon as only homeRegionID based UserServers are around. - // TODO: The HomeRegion property can be removed then, too - UserProfile.HomeRegion = RegionInfo.RegionHandle; - - UserProfile.HomeLocation = position; - UserProfile.HomeLookAt = lookAt; - CommsManager.UserService.UpdateUserProfile(UserProfile); - + if (PresenceService.SetHomeLocation(remoteClient.AgentId.ToString(), RegionInfo.RegionID, position, lookAt)) // FUBAR ALERT: this needs to be "Home position set." so the viewer saves a home-screenshot. m_dialogModule.SendAlertToUser(remoteClient, "Home position set."); - } else - { m_dialogModule.SendAlertToUser(remoteClient, "Set Home request Failed."); - } } /// @@ -3254,12 +3239,6 @@ namespace OpenSim.Region.Framework.Scenes m_log.Error("[SCENE] Scene.cs:RemoveClient exception: " + e.ToString()); } - // Remove client agent from profile, so new logins will work - if (!childagentYN) - { - m_sceneGridService.ClearUserAgent(agentID); - } - m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode); //m_log.InfoFormat("[SCENE] Memory pre GC {0}", System.GC.GetTotalMemory(false)); diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index f612d17..53693e4 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -1455,11 +1455,6 @@ namespace OpenSim.Region.Framework.Scenes m_commsProvider.LogOffUser(userid, regionid, regionhandle, posx, posy, posz); } - public void ClearUserAgent(UUID avatarID) - { - m_commsProvider.UserService.ClearUserAgent(avatarID); - } - public void AddNewUserFriend(UUID friendlistowner, UUID friend, uint perms) { m_commsProvider.AddNewUserFriend(friendlistowner, friend, perms); -- cgit v1.1