From b1c8d0588829dfa76f89460eeb8406d9c4fc479f Mon Sep 17 00:00:00 2001 From: Master ScienceSim Date: Wed, 20 Oct 2010 16:17:54 -0700 Subject: Major refactoring of appearance handling. AvatarService -- add two new methods, GetAppearance and SetAppearance to get around the lossy encoding in AvatarData. Preseve the old functions to avoid changing the behavior for ROBUST services. AvatarAppearance -- major refactor, moved the various encoding methods used by AgentCircuitData, ClientAgentUpdate and ScenePresence into one location. Changed initialization. AvatarAttachments -- added a class specifically to handle attachments in preparation for additional functionality that will be needed for viewer 2. AvatarFactory -- removed a number of unused or methods duplicated in other locations. Moved in all appearance event handling from ScenePresence. Required a change to IClientAPI that propogated throughout all the IClientAPI implementations. --- OpenSim/Region/Framework/Scenes/Scene.cs | 7 ------- 1 file changed, 7 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 0cfc235..c69c9b1 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -119,7 +119,6 @@ namespace OpenSim.Region.Framework.Scenes protected IXMLRPC m_xmlrpcModule; protected IWorldComm m_worldCommModule; - protected IAvatarFactory m_AvatarFactory; protected IConfigSource m_config; protected IRegionSerialiserModule m_serialiser; protected IDialogModule m_dialogModule; @@ -399,11 +398,6 @@ namespace OpenSim.Region.Framework.Scenes public IAttachmentsModule AttachmentsModule { get; set; } - public IAvatarFactory AvatarFactory - { - get { return m_AvatarFactory; } - } - public ICapabilitiesModule CapsModule { get { return m_capsModule; } @@ -1161,7 +1155,6 @@ namespace OpenSim.Region.Framework.Scenes m_xmlrpcModule = RequestModuleInterface(); m_worldCommModule = RequestModuleInterface(); XferManager = RequestModuleInterface(); - m_AvatarFactory = RequestModuleInterface(); AttachmentsModule = RequestModuleInterface(); m_serialiser = RequestModuleInterface(); m_dialogModule = RequestModuleInterface(); -- cgit v1.1 From 5968d343bb21af4c73f1d925837560f953e5ef61 Mon Sep 17 00:00:00 2001 From: dahlia Date: Tue, 26 Oct 2010 21:19:33 -0700 Subject: Overload Scene.NewUserConnection() to facilitate NPCs and other region specific applications --- OpenSim/Region/Framework/Scenes/Scene.cs | 36 ++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 9 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') 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 m_log.WarnFormat("[SCENE]: Deregister from grid failed for region {0}", m_regInfo.RegionName); } - /// /// 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 @@ -3291,6 +3290,23 @@ namespace OpenSim.Region.Framework.Scenes /// also return a reason. public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason) { + return NewUserConnection(agent, teleportFlags, out reason, true); + } + + /// + /// 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. + /// + /// CircuitData of the agent who is connecting + /// Outputs the reason for the false response on this string + /// True for normal presence. False for NPC + /// or other applications where a full grid/Hypergrid presence may not be required. + /// True if the region accepts this agent. False if it does not. False will + /// also return a reason. + public bool NewUserConnection(AgentCircuitData agent, uint teleportFlags, out string reason, bool requirePresenceLookup) + { bool vialogin = ((teleportFlags & (uint)Constants.TeleportFlags.ViaLogin) != 0 || (teleportFlags & (uint)Constants.TeleportFlags.ViaHGLogin) != 0); reason = String.Empty; @@ -3339,16 +3355,18 @@ namespace OpenSim.Region.Framework.Scenes 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; - } - catch (Exception e) - { - m_log.ErrorFormat("[CONNECTION BEGIN]: Exception verifying presence " + e.ToString()); - return false; + } } try -- cgit v1.1