diff --git a/OpenSim/Capabilities/Caps.cs b/OpenSim/Capabilities/Caps.cs index 82ecd55f04..99319345f6 100644 --- a/OpenSim/Capabilities/Caps.cs +++ b/OpenSim/Capabilities/Caps.cs @@ -119,6 +119,17 @@ namespace OpenSim.Framework.Capabilities get { return m_externalCapsHandlers; } } + [Flags] + public enum CapsFlags:uint + { + None = 0, + SentSeeds = 1, + + ObjectAnim = 0x10 + } + + public CapsFlags Flags { get; set;} + public Caps(IHttpServer httpServer, string httpListen, uint httpPort, string capsPath, UUID agent, string regionName) { @@ -138,12 +149,18 @@ namespace OpenSim.Framework.Capabilities m_agentID = agent; m_capsHandlers = new CapsHandlers(httpServer, httpListen, httpPort); m_regionName = regionName; + Flags = CapsFlags.None; m_capsActive.Reset(); } ~Caps() { - m_capsActive.Dispose(); + Flags = CapsFlags.None; + if (m_capsActive!= null) + { + m_capsActive.Dispose(); + m_capsActive = null; + } } /// @@ -262,6 +279,7 @@ namespace OpenSim.Framework.Capabilities caps[kvp.Key] = kvp.Value; } + Flags |= CapsFlags.SentSeeds; return caps; } diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 8f7d49c9b3..d1f5378a70 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -710,7 +710,7 @@ namespace OpenSim.Framework Vector3 StartPos { get; set; } UUID AgentId { get; } - bool DoObjectAnimations { get; set; } + bool SupportObjectAnimations { get; set; } /// /// The scene agent for this client. This will only be set if the client has an agent in a scene (i.e. if it diff --git a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs index f54c5f5941..92f5a2cc24 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/BunchOfCaps/BunchOfCaps.cs @@ -374,7 +374,12 @@ namespace OpenSim.Region.ClientStack.Linden List validCaps = new List(); foreach (OSD c in capsRequested) - validCaps.Add(c.AsString()); + { + string cstr = c.AsString(); + if(cstr == "ObjectAnimation") + m_HostCapsObj.Flags |= Caps.CapsFlags.ObjectAnim; + validCaps.Add(cstr); + } string result = LLSDHelpers.SerialiseLLSDReply(m_HostCapsObj.GetCapsDetails(true, validCaps)); diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 7866997847..34e3a43892 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -351,7 +351,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP #pragma warning restore 0414 private const uint MaxTransferBytesPerPacket = 600; - public bool DoObjectAnimations { get; set; } + public bool SupportObjectAnimations { get; set; } /// /// Maintain a record of all the objects killed. This allows us to stop an update being sent from the @@ -3917,7 +3917,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendObjectAnimations(UUID[] animations, int[] seqs, UUID senderId) { // m_log.DebugFormat("[LLCLIENTVIEW]: Sending Object animations for {0} to {1}", sourceAgentId, Name); - if(!DoObjectAnimations) + if(!SupportObjectAnimations) return; ObjectAnimationPacket ani = (ObjectAnimationPacket)PacketPool.Instance.GetPacket(PacketType.ObjectAnimation); @@ -4330,7 +4330,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (update.Entity is SceneObjectPart) { - if (DoObjectAnimations && updateFlags.HasFlag(PrimUpdateFlags.Animations)) + if (SupportObjectAnimations && updateFlags.HasFlag(PrimUpdateFlags.Animations)) { SceneObjectPart sop = (SceneObjectPart)update.Entity; if ( sop.Animations != null) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index afa1e4c8ff..667acf970c 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -1919,38 +1919,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP uint circuitCode, UUID agentID, UUID sessionID, IPEndPoint remoteEndPoint, AuthenticateResponse sessionInfo) { IClientAPI client = null; - bool createNew = false; // We currently synchronize this code across the whole scene to avoid issues such as // http://opensimulator.org/mantis/view.php?id=5365 However, once locking per agent circuit can be done // consistently, this lock could probably be removed. lock (this) { - if (!Scene.TryGetClient(agentID, out client)) + if (Scene.TryGetClient(agentID, out client)) { - createNew = true; - } - else - { - if (client.SceneAgent == null) - { - Scene.CloseAgent(agentID, true); - createNew = true; - } + if (client.SceneAgent != null) + return client; + Scene.CloseAgent(agentID, true); } - if (createNew) - { - LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, Throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO); + LLUDPClient udpClient = new LLUDPClient(this, ThrottleRates, Throttle, circuitCode, agentID, remoteEndPoint, m_defaultRTO, m_maxRTO); - client = new LLClientView(Scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode); - client.OnLogout += LogoutHandler; - client.DebugPacketLevel = DefaultClientPacketDebugLevel; + client = new LLClientView(Scene, this, udpClient, sessionInfo, agentID, sessionID, circuitCode); + client.OnLogout += LogoutHandler; + client.DebugPacketLevel = DefaultClientPacketDebugLevel; - ((LLClientView)client).DisableFacelights = m_disableFacelights; + ((LLClientView)client).DisableFacelights = m_disableFacelights; - client.Start(); - } + client.Start(); } return client; diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a8d2f848fe..ed9804686a 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3111,12 +3111,6 @@ namespace OpenSim.Region.Framework.Scenes m_LastLogin = Util.EnvironmentTickCount(); -//HACK only send object animations to fs beta for now - string viewername = Util.GetViewerName(aCircuit); - if(sp != null && viewername.StartsWith("Firestorm-Betax64 6")) - { - sp.ControllingClient.DoObjectAnimations = true; - } return sp; } @@ -3207,36 +3201,29 @@ namespace OpenSim.Region.Framework.Scenes public override bool CheckClient(UUID agentID, System.Net.IPEndPoint ep) { AgentCircuitData aCircuit = m_authenticateHandler.GetAgentCircuitData(agentID); - if (aCircuit != null) + if (aCircuit == null) + return false; + + bool vialogin = false; + if (VerifyClient(aCircuit, ep, out vialogin)) + return true; + + // if it doesn't pass, we remove the agentcircuitdata altogether + // and the scene presence and the client, if they exist + try { - bool vialogin = false; - if (!VerifyClient(aCircuit, ep, out vialogin)) + ScenePresence sp = WaitGetScenePresence(agentID); + if (sp != null) { - // if it doesn't pass, we remove the agentcircuitdata altogether - // and the scene presence and the client, if they exist - try - { - ScenePresence sp = WaitGetScenePresence(agentID); - - if (sp != null) - { - PresenceService.LogoutAgent(sp.ControllingClient.SessionId); - - CloseAgent(sp.UUID, false); - } - - // BANG! SLASH! - m_authenticateHandler.RemoveCircuit(agentID); - - return false; - } - catch (Exception e) - { - m_log.DebugFormat("[SCENE]: Exception while closing aborted client: {0}", e.StackTrace); - } + PresenceService.LogoutAgent(sp.ControllingClient.SessionId); + CloseAgent(sp.UUID, false); } - else - return true; + // BANG! SLASH! + m_authenticateHandler.RemoveCircuit(agentID); + } + catch (Exception e) + { + m_log.DebugFormat("[SCENE]: Exception while closing aborted client: {0}", e.StackTrace); } return false; diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 2b6c5e6505..527f12ea2c 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -45,6 +45,7 @@ using OpenSim.Region.PhysicsModules.SharedBase; using GridRegion = OpenSim.Services.Interfaces.GridRegion; using OpenSim.Services.Interfaces; using TeleportFlags = OpenSim.Framework.Constants.TeleportFlags; +using Caps = OpenSim.Framework.Capabilities.Caps; namespace OpenSim.Region.Framework.Scenes { @@ -1110,6 +1111,14 @@ namespace OpenSim.Region.Framework.Scenes HealRate = 0.5f; + ControllingClient.SupportObjectAnimations = false; + if (m_scene.CapsModule != null) + { + Caps cap = m_scene.CapsModule.GetCapsForUser(ControllingClient.CircuitCode); + if (cap != null && (cap.Flags & Caps.CapsFlags.ObjectAnim) != 0) + ControllingClient.SupportObjectAnimations = true; + } + IConfig sconfig = m_scene.Config.Configs["EntityTransfer"]; if (sconfig != null) { diff --git a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs index 5962495abf..febf995c16 100644 --- a/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs +++ b/OpenSim/Region/OptionalModules/Agent/InternetRelayClientView/Server/IRCClientView.cs @@ -60,7 +60,7 @@ namespace OpenSim.Region.OptionalModules.Agent.InternetRelayClientView.Server public int PingTimeMS { get { return 0; } } - public bool DoObjectAnimations { get; set; } + public bool SupportObjectAnimations { get; set; } private string m_username; private string m_nick; diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs index cbb7e60762..0984c60dd8 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs @@ -73,7 +73,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC private UUID m_profileImage = UUID.Zero; private string m_born; public List SelectedObjects {get; private set;} - public bool DoObjectAnimations { get; set; } + public bool SupportObjectAnimations { get; set; } public NPCAvatar( string firstname, string lastname, Vector3 position, UUID ownerID, bool senseAsAgent, Scene scene) diff --git a/OpenSim/Tests/Common/Mock/TestClient.cs b/OpenSim/Tests/Common/Mock/TestClient.cs index 151dcca681..b0ede78ad1 100644 --- a/OpenSim/Tests/Common/Mock/TestClient.cs +++ b/OpenSim/Tests/Common/Mock/TestClient.cs @@ -354,7 +354,7 @@ namespace OpenSim.Tests.Common public ISceneAgent SceneAgent { get; set; } - public bool DoObjectAnimations { get; set; } + public bool SupportObjectAnimations { get; set; } /// /// The last caps seed url that this client was given.