aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authordahlia2010-10-26 21:19:33 -0700
committerdahlia2010-10-26 21:19:33 -0700
commit5968d343bb21af4c73f1d925837560f953e5ef61 (patch)
tree1073190f9a12011b754d21e847244f4cdd8939ab /OpenSim
parent* Updated libomv to r3461 (diff)
downloadopensim-SC-5968d343bb21af4c73f1d925837560f953e5ef61.zip
opensim-SC-5968d343bb21af4c73f1d925837560f953e5ef61.tar.gz
opensim-SC-5968d343bb21af4c73f1d925837560f953e5ef61.tar.bz2
opensim-SC-5968d343bb21af4c73f1d925837560f953e5ef61.tar.xz
Overload Scene.NewUserConnection() to facilitate NPCs and other region specific applications
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs36
1 files changed, 27 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 3dd0f3a..f0ae45e 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3278,7 +3278,6 @@ namespace OpenSim.Region.Framework.Scenes
3278 m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", m_regInfo.RegionName); 3278 m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", m_regInfo.RegionName);
3279 } 3279 }
3280 3280
3281
3282 /// <summary> 3281 /// <summary>
3283 /// Do the work necessary to initiate a new user connection for a particular scene. 3282 /// Do the work necessary to initiate a new user connection for a particular scene.
3284 /// At the moment, this consists of setting up the caps infrastructure 3283 /// At the moment, this consists of setting up the caps infrastructure
@@ -3291,6 +3290,23 @@ namespace OpenSim.Region.Framework.Scenes
3291 /// also return a reason.</returns> 3290 /// also return a reason.</returns>
3292 public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason) 3291 public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason)
3293 { 3292 {
3293 return NewUserConnection(agent, teleportFlags, out reason, true);
3294 }
3295
3296 /// <summary>
3297 /// Do the work necessary to initiate a new user connection for a particular scene.
3298 /// At the moment, this consists of setting up the caps infrastructure
3299 /// The return bool should allow for connections to be refused, but as not all calling paths
3300 /// take proper notice of it let, we allowed banned users in still.
3301 /// </summary>
3302 /// <param name="agent">CircuitData of the agent who is connecting</param>
3303 /// <param name="reason">Outputs the reason for the false response on this string</param>
3304 /// <param name="requirePresenceLookup">True for normal presence. False for NPC
3305 /// or other applications where a full grid/Hypergrid presence may not be required.</param>
3306 /// <returns>True if the region accepts this agent. False if it does not. False will
3307 /// also return a reason.</returns>
3308 public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason, bool requirePresenceLookup)
3309 {
3294 bool vialogin = ((teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0 || 3310 bool vialogin = ((teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0 ||
3295 (teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0); 3311 (teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0);
3296 reason = String.Empty; 3312 reason = String.Empty;
@@ -3339,16 +3355,18 @@ namespace OpenSim.Region.Framework.Scenes
3339 3355
3340 if (sp == null) // We don't have an [child] agent here already 3356 if (sp == null) // We don't have an [child] agent here already
3341 { 3357 {
3342 3358 if (requirePresenceLookup)
3343 try
3344 { 3359 {
3345 if (!VerifyUserPresence(agent, out reason)) 3360 try
3361 {
3362 if (!VerifyUserPresence(agent, out reason))
3363 return false;
3364 }
3365 catch (Exception e)
3366 {
3367 m_log.ErrorFormat("[CONNECTION BEGIN]: Exception verifying presence " + e.ToString());
3346 return false; 3368 return false;
3347 } 3369 }
3348 catch (Exception e)
3349 {
3350 m_log.ErrorFormat("[CONNECTION BEGIN]: Exception verifying presence " + e.ToString());
3351 return false;
3352 } 3370 }
3353 3371
3354 try 3372 try