diff --git a/OpenSim/Framework/Client/IClientInventory.cs b/OpenSim/Framework/Client/IClientInventory.cs index 00651e0917..d59f8b7151 100644 --- a/OpenSim/Framework/Client/IClientInventory.cs +++ b/OpenSim/Framework/Client/IClientInventory.cs @@ -33,5 +33,6 @@ namespace OpenSim.Framework.Client public interface IClientInventory { void SendRemoveInventoryFolders(UUID[] folders); + void SendRemoveInventoryItems(UUID[] folders); } } diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 557ab305c8..dd18b16694 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -12423,6 +12423,44 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(reply, ThrottleOutPacketType.Task); } + public void SendRemoveInventoryItems(UUID[] items) + { + IEventQueue eq = Scene.RequestModuleInterface(); + + if (eq == null) + { + m_log.DebugFormat("[LLCLIENT]: Null event queue"); + return; + } + + OSDMap llsd = new OSDMap(3); + + OSDMap AgentDataMap = new OSDMap(1); + AgentDataMap.Add("AgentID", OSD.FromUUID(AgentId)); + AgentDataMap.Add("SessionID", OSD.FromUUID(SessionId)); + + OSDArray AgentData = new OSDArray(1); + AgentData.Add(AgentDataMap); + + llsd.Add("AgentData", AgentData); + + OSDArray ItemData = new OSDArray(); + + foreach (UUID item in items) + { + OSDMap ItemDataMap = new OSDMap(2); + ItemDataMap.Add("ItemID", OSD.FromUUID(item)); + ItemDataMap.Add("AgentID", OSD.FromUUID(AgentId)); + + ItemData.Add(ItemDataMap); + } + + llsd.Add("ItemData", ItemData); + + eq.Enqueue(BuildEvent("RemoveInventoryItem", + llsd), AgentId); + } + public void SendRemoveInventoryFolders(UUID[] folders) { IEventQueue eq = Scene.RequestModuleInterface(); diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index 853491b2e0..470ce2e4a1 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs @@ -72,9 +72,11 @@ namespace OpenSim.Region.Framework.Scenes public delegate void OnNewClientDelegate(IClientAPI client); /// - /// Deprecated in favour of OnClientConnect. - /// Will be marked Obsolete after IClientCore has 100% of IClientAPI interfaces. + /// Triggered when a new client is added to the scene. /// + /// + /// Triggered before OnClientLogin. + /// public event OnNewClientDelegate OnNewClient; /// @@ -192,6 +194,12 @@ namespace OpenSim.Region.Framework.Scenes public delegate void ClientClosed(UUID clientID, Scene scene); + /// + /// Fired when a client is removed from a scene. + /// + /// + /// At the point of firing, the scene still contains the client's scene presence. + /// public event ClientClosed OnClientClosed; public delegate void NewScript(UUID clientID, SceneObjectPart part, UUID itemID); diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs index 0be0a195dd..4dbac1dd97 100644 --- a/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs +++ b/OpenSim/Region/OptionalModules/Avatar/Voice/VivoxVoice/VivoxVoiceModule.cs @@ -221,15 +221,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice } } - // Called to indicate that the module has been added to the region public void AddRegion(Scene scene) { - if (m_pluginEnabled) { lock (vlock) { - string channelId; string sceneUUID = scene.RegionInfo.RegionID.ToString(); @@ -273,23 +270,22 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice } } - // Create a dictionary entry unconditionally. This eliminates the // need to check for a parent in the core code. The end result is // the same, if the parent table entry is an empty string, then // region channels will be created as first-level channels. - - lock (m_parents) - if (m_parents.ContainsKey(sceneUUID)) - { - RemoveRegion(scene); - m_parents.Add(sceneUUID, channelId); - } - else - { - m_parents.Add(sceneUUID, channelId); - } - + lock (m_parents) + { + if (m_parents.ContainsKey(sceneUUID)) + { + RemoveRegion(scene); + m_parents.Add(sceneUUID, channelId); + } + else + { + m_parents.Add(sceneUUID, channelId); + } + } } // we need to capture scene in an anonymous method @@ -298,26 +294,20 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice { OnRegisterCaps(scene, agentID, caps); }; - } - } - - // Called to indicate that all loadable modules have now been added + public void RegionLoaded(Scene scene) { // Do nothing. } - // Called to indicate that the region is going away. public void RemoveRegion(Scene scene) { - if (m_pluginEnabled) { lock (vlock) { - string channelId; string sceneUUID = scene.RegionInfo.RegionID.ToString(); @@ -328,10 +318,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice // iteration over the set of chidren identified. // This assumes that there is just one directory per // region. - if (VivoxTryGetDirectory(sceneUUID + "D", out channelId)) { - m_log.DebugFormat("[VivoxVoice]: region {0}: uuid {1}: located directory id {2}", sceneName, sceneUUID, channelId); @@ -360,7 +348,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice lock (m_parents) { - if (m_parents.ContainsKey(sceneUUID)) + if (m_parents.ContainsKey(sceneUUID)) { m_parents.Remove(sceneUUID); } @@ -459,11 +447,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice { try { - ScenePresence avatar = null; string avatarName = null; - if (scene == null) throw new Exception("[VivoxVoice][PROVISIONVOICE] Invalid scene"); + if (scene == null) + throw new Exception("[VivoxVoice][PROVISIONVOICE]: Invalid scene"); avatar = scene.GetScenePresence(agentID); while (avatar == null) @@ -566,7 +554,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice } } } - } while (retry); + } + while (retry); if (code != "OK") { @@ -676,7 +665,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice } } - /// /// Callback for a client request for a private chat channel /// @@ -698,10 +686,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice return "true"; } - private string RegionGetOrCreateChannel(Scene scene, LandData land) { - string channelUri = null; string channelId = null; @@ -709,11 +695,11 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice string landName; string parentId; - lock (m_parents) parentId = m_parents[scene.RegionInfo.RegionID.ToString()]; + lock (m_parents) + parentId = m_parents[scene.RegionInfo.RegionID.ToString()]; // Create parcel voice channel. If no parcel exists, then the voice channel ID is the same // as the directory ID. Otherwise, it reflects the parcel's ID. - if (land.LocalID != 1 && (land.Flags & (uint)ParcelFlags.UseEstateVoiceChan) == 0) { landName = String.Format("{0}:{1}", scene.RegionInfo.RegionName, land.Name); @@ -741,8 +727,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice m_log.DebugFormat("[VivoxVoice]: Region:Parcel \"{0}\": parent channel id {1}: retrieved parcel channel_uri {2} ", landName, parentId, channelUri); - - } return channelUri; @@ -761,7 +745,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice return VivoxCall(requrl, false); } - private static readonly string m_vivoxLogoutPath = "https://{0}/api2/viv_signout.php?auth_token={1}"; /// @@ -828,7 +811,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice /// /// In this case the call handles parent and description as optional values. /// - private bool VivoxTryCreateChannel(string parent, string channelId, string description, out string channelUri) { string requrl = String.Format(m_vivoxChannelPath, m_vivoxServer, "create", channelId, m_authToken); @@ -864,7 +846,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice /// channel name space. /// The parent and description are optional values. /// - private bool VivoxTryCreateDirectory(string dirId, string description, out string channelId) { string requrl = String.Format(m_vivoxChannelPath, m_vivoxServer, "create", dirId, m_authToken); @@ -901,7 +882,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice /// are required in a later phase. /// In this case the call handles parent and description as optional values. /// - private bool VivoxTryGetChannel(string channelParent, string channelName, out string channelId, out string channelUri) { @@ -1044,6 +1024,8 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice // return VivoxCall(requrl, true); // } + private static readonly string m_vivoxChannelDel = "https://{0}/api2/viv_chan_mod.php?mode={1}&chan_id={2}&auth_token={3}"; + /// /// Delete a channel. /// Once again, there a multitude of options possible. In the simplest case @@ -1056,8 +1038,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice /// In this case the call handles parent and description as optional values. /// - private static readonly string m_vivoxChannelDel = "https://{0}/api2/viv_chan_mod.php?mode={1}&chan_id={2}&auth_token={3}"; - private XmlElement VivoxDeleteChannel(string parent, string channelid) { string requrl = String.Format(m_vivoxChannelDel, m_vivoxServer, "delete", channelid, m_authToken); @@ -1068,12 +1048,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice return VivoxCall(requrl, true); } + private static readonly string m_vivoxChannelSearch = "https://{0}/api2/viv_chan_search.php?&cond_chanparent={1}&auth_token={2}"; + /// /// Return information on channels in the given directory /// - private static readonly string m_vivoxChannelSearch = "https://{0}/api2/viv_chan_search.php?&cond_chanparent={1}&auth_token={2}"; - private XmlElement VivoxListChildren(string channelid) { string requrl = String.Format(m_vivoxChannelSearch, m_vivoxServer, channelid, m_authToken); @@ -1118,7 +1098,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice /// The outcome of the call can be determined by examining the /// status value in the hash table. /// - private XmlElement VivoxCall(string requrl, bool admin) { @@ -1164,7 +1143,6 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.VivoxVoice /// /// Just say if it worked. /// - private bool IsOK(XmlElement resp) { string status;