From 9aa2484f0d33b8fcce2810bd36b70c9ceb61c2f5 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 11 Aug 2016 08:38:39 +0100 Subject: [PATCH] to do that don't use slideexpiration; add cap event ChatterBoxForceClose --- .../Linden/Caps/EventQueue/EventQueueGetModule.cs | 10 +++++++++- .../Linden/Caps/EventQueue/EventQueueHelper.cs | 12 ++++++++++++ OpenSim/Region/Framework/Interfaces/IEventQueue.cs | 11 ++++++----- .../XmlRpcGroupsServicesConnectorModule.cs | 2 +- OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs | 5 +++++ 5 files changed, 33 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index 6d548ada23..b9038bd6d0 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs @@ -372,7 +372,7 @@ namespace OpenSim.Region.ClientStack.Linden caps.RegisterPollHandler( "EventQueueGet", - new PollServiceEventArgs(null, GenerateEqgCapPath(eventQueueGetUUID), HasEvents, GetEvents, NoEvents, agentID, SERVER_EQ_TIME_NO_EVENTS)); + new PollServiceEventArgs(null, GenerateEqgCapPath(eventQueueGetUUID), HasEvents, GetEvents, NoEvents, Drop, agentID, SERVER_EQ_TIME_NO_EVENTS)); } public bool HasEvents(UUID requestID, UUID agentID) @@ -577,6 +577,14 @@ namespace OpenSim.Region.ClientStack.Linden //m_log.InfoFormat("########### eq ChatterBoxSessionAgentListUpdates #############\n{0}", item); } + public void ChatterBoxForceClose(UUID toAgent, UUID sessionID, string reason) + { + OSD item = EventQueueHelper.ChatterBoxForceClose(sessionID, reason); + + Enqueue(item, toAgent); + //m_log.InfoFormat("########### eq ChatterBoxSessionAgentListUpdates #############\n{0}", item); + } + public void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID) { OSD item = EventQueueHelper.ParcelProperties(parcelPropertiesMessage); diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs index d552914e81..5e0bd71797 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueHelper.cs @@ -342,6 +342,18 @@ namespace OpenSim.Region.ClientStack.Linden return chatterBoxSessionAgentListUpdates; } + public static OSD ChatterBoxForceClose(UUID sessionID, string reason) + { + OSDMap body = new OSDMap(2); + body.Add("session_id", new OSDUUID(sessionID)); + body.Add("reason", new OSDString(reason)); + + OSDMap chatterBoxForceClose = new OSDMap(2); + chatterBoxForceClose.Add("message", new OSDString("ForceCloseChatterBoxSession")); + chatterBoxForceClose.Add("body", body); + return chatterBoxForceClose; + } + public static OSD GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data) { OSDArray AgentData = new OSDArray(1); diff --git a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs index b52576984a..3f54ea5bff 100644 --- a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs +++ b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs @@ -52,11 +52,12 @@ namespace OpenSim.Region.Framework.Interfaces string capsURL, UUID avatarID, UUID sessionID, int regionSizeX, int regionSizeY); void ChatterboxInvitation(UUID sessionID, string sessionName, - UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, - uint timeStamp, bool offline, int parentEstateID, Vector3 position, - uint ttl, UUID transactionID, bool fromGroup, byte[] binaryBucket); - void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID fromAgent, UUID anotherAgent, bool canVoiceChat, - bool isModerator, bool textMute, bool isEnterorLeave); + UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, + uint timeStamp, bool offline, int parentEstateID, Vector3 position, + uint ttl, UUID transactionID, bool fromGroup, byte[] binaryBucket); + void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID fromAgent, UUID anotherAgent, + bool canVoiceChat, bool isModerator, bool textMute, bool isEnterorLeave); + void ChatterBoxForceClose(UUID toAgent, UUID sessionID, string reason); void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID); void GroupMembershipData(UUID receiverAgent, GroupMembershipData[] data); OSD ScriptRunningEvent(UUID objectID, UUID itemID, bool running, bool mono); diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs index 88189c9f31..eb64f715a6 100644 --- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs @@ -1011,7 +1011,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups if ((m_cacheTimeout > 0) && (CacheKey != null)) { - m_memoryCache.AddOrUpdate(CacheKey, resp, TimeSpan.FromSeconds(10)); + m_memoryCache.AddOrUpdate(CacheKey, resp, 10.0); } } diff --git a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs index 417efce63c..bc30945dab 100644 --- a/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs +++ b/OpenSim/Tests/Common/Mock/TestEventQueueGetModule.cs @@ -152,6 +152,11 @@ namespace OpenSim.Tests.Common AddEvent(toAgent, "ChatterBoxSessionAgentListUpdates", sessionID, fromAgent, canVoiceChat, isModerator, textMute, isEnterorLeave); } + public void ChatterBoxForceClose (UUID toAgent, UUID sessionID, string reason) + { + AddEvent(toAgent, "ForceCloseChatterBoxSession", sessionID, reason); + } + public void ParcelProperties (OpenMetaverse.Messages.Linden.ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID) { AddEvent(avatarID, "ParcelProperties", parcelPropertiesMessage);