From a58859a0d4206c194c9c56212218e2cafc2cc373 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 7 May 2010 21:29:56 -0700 Subject: GridUserService in place. Replaces the contrived concept of storing user's home and position info in the presence service. WARNING: I violated a taboo by deleting 2 migration files and simplifying the original table creation for Presence. This should not cause any problems to anyone, though. Things will work with the new simplified table, as well as with the previous contrived one. If there are any problems, solving them is as easy as dropping the presence table and deleting its row in the migrations table. The presence info only exists during a user's session anyway. BTW, the Meshing files want to be committed too -- EOFs. --- OpenSim/Region/Framework/Scenes/Scene.cs | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 1a46837..c0fa7b4 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -304,7 +304,18 @@ namespace OpenSim.Region.Framework.Scenes return m_AvatarService; } } - + + protected IGridUserService m_GridUserService; + public IGridUserService GridUserService + { + get + { + if (m_GridUserService == null) + m_GridUserService = RequestModuleInterface(); + return m_GridUserService; + } + } + protected IXMLRPC m_xmlrpcModule; protected IWorldComm m_worldCommModule; public IAttachmentsModule AttachmentsModule { get; set; } @@ -1306,8 +1317,8 @@ namespace OpenSim.Region.Framework.Scenes if (defaultRegions != null && defaultRegions.Count >= 1) home = defaultRegions[0]; - if (PresenceService != null && home != null) - PresenceService.SetHomeLocation(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); + if (GridUserService != null && home != null) + GridUserService.SetHome(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0)); else m_log.WarnFormat("[USER ACCOUNT SERVICE]: Unable to set home for account {0} {1}.", first, last); @@ -3095,7 +3106,7 @@ namespace OpenSim.Region.Framework.Scenes /// public virtual void SetHomeRezPoint(IClientAPI remoteClient, ulong regionHandle, Vector3 position, Vector3 lookAt, uint flags) { - if (PresenceService.SetHomeLocation(remoteClient.AgentId.ToString(), RegionInfo.RegionID, position, lookAt)) + if (GridUserService != null && GridUserService.SetHome(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 @@ -3543,7 +3554,7 @@ namespace OpenSim.Region.Framework.Scenes OpenSim.Services.Interfaces.PresenceInfo pinfo = presence.GetAgent(agent.SessionID); - if (pinfo == null || (pinfo != null && pinfo.Online == false)) + if (pinfo == null) { reason = String.Format("Failed to verify user {0} {1}, access denied to region {2}.", agent.firstname, agent.lastname, RegionInfo.RegionName); return false; -- cgit v1.1