* backport master commit 5968d343bb
Overload Scene.NewUserConnection() to facilitate NPCs and other region specific applications0.7.0.1-post-fixes
parent
105a51e3dd
commit
9356dc880f
|
@ -3434,6 +3434,23 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <returns>True if the region accepts this agent. False if it does not. False will
|
/// <returns>True if the region accepts this agent. False if it does not. False will
|
||||||
/// also return a reason.</returns>
|
/// also return a reason.</returns>
|
||||||
public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason)
|
public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason)
|
||||||
|
{
|
||||||
|
return NewUserConnection(agent, teleportFlags, out reason, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Do the work necessary to initiate a new user connection for a particular scene.
|
||||||
|
/// At the moment, this consists of setting up the caps infrastructure
|
||||||
|
/// The return bool should allow for connections to be refused, but as not all calling paths
|
||||||
|
/// take proper notice of it let, we allowed banned users in still.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="agent">CircuitData of the agent who is connecting</param>
|
||||||
|
/// <param name="reason">Outputs the reason for the false response on this string</param>
|
||||||
|
/// <param name="requirePresenceLookup">True for normal presence. False for NPC
|
||||||
|
/// or other applications where a full grid/Hypergrid presence may not be required.</param>
|
||||||
|
/// <returns>True if the region accepts this agent. False if it does not. False will
|
||||||
|
/// also return a reason.</returns>
|
||||||
|
public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason, bool requirePresenceLookup)
|
||||||
{
|
{
|
||||||
TeleportFlags tp = (TeleportFlags)teleportFlags;
|
TeleportFlags tp = (TeleportFlags)teleportFlags;
|
||||||
reason = String.Empty;
|
reason = String.Empty;
|
||||||
|
@ -3483,15 +3500,18 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (sp == null) // We don't have an [child] agent here already
|
if (sp == null) // We don't have an [child] agent here already
|
||||||
{
|
{
|
||||||
|
|
||||||
try
|
if (requirePresenceLookup)
|
||||||
{
|
{
|
||||||
if (!VerifyUserPresence(agent, out reason))
|
try
|
||||||
|
{
|
||||||
|
if (!VerifyUserPresence(agent, out reason))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
m_log.ErrorFormat("[CONNECTION BEGIN]: Exception verifying presence " + e.ToString());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
m_log.DebugFormat("[CONNECTION BEGIN]: Exception verifying presence {0}", e.Message);
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
|
|
Loading…
Reference in New Issue