OpenSim.Region.Framework.Scenes.Scene.VerifyUserPresence C# (CSharp) Method

VerifyUserPresence() public method

Verifies that the user has a presence on the Grid
public VerifyUserPresence ( AgentCircuitData agent, string &reason ) : bool
agent AgentCircuitData Circuit Data of the Agent we're verifying
reason string Outputs the reason for the false response on this string
return bool
        public virtual bool VerifyUserPresence(AgentCircuitData agent, out string reason)
        {
            reason = String.Empty;

            IPresenceService presence = RequestModuleInterface<IPresenceService>();
            if (presence == null)
            {
                reason = String.Format("Failed to verify user presence in the grid for {0} {1} in region {2}. Presence service does not exist.", agent.firstname, agent.lastname, RegionInfo.RegionName);
                return false;
            }

            OpenSim.Services.Interfaces.PresenceInfo pinfo = presence.GetAgent(agent.SessionID);

            if (pinfo == null)
            {
                reason = String.Format("Failed to verify user presence in the grid for {0} {1}, access denied to region {2}.", agent.firstname, agent.lastname, RegionInfo.RegionName);
                return false;
            }

            return true;
        }
Scene