diff options
author | UbitUmarov | 2018-01-04 20:56:48 +0000 |
---|---|---|
committer | UbitUmarov | 2018-01-04 20:56:48 +0000 |
commit | 48dbba34416e31fa9d525007807b070d0eb25cf9 (patch) | |
tree | 7bf4c4e9c7804e8b232eaadab0ea66a7658c9c3d /OpenSim/Region/CoreModules | |
parent | fix estates URI (diff) | |
download | opensim-SC_OLD-48dbba34416e31fa9d525007807b070d0eb25cf9.zip opensim-SC_OLD-48dbba34416e31fa9d525007807b070d0eb25cf9.tar.gz opensim-SC_OLD-48dbba34416e31fa9d525007807b070d0eb25cf9.tar.bz2 opensim-SC_OLD-48dbba34416e31fa9d525007807b070d0eb25cf9.tar.xz |
add more files for robust mutes suport. (module is still named MuteListModuleTst for testing, others in core will be removed later
Diffstat (limited to 'OpenSim/Region/CoreModules')
2 files changed, 154 insertions, 3 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MuteList/LocalMuteListServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MuteList/LocalMuteListServiceConnector.cs index 833d883..37b30aa 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MuteList/LocalMuteListServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MuteList/LocalMuteListServiceConnector.cs | |||
@@ -38,7 +38,7 @@ using OpenSim.Region.Framework.Scenes; | |||
38 | using OpenSim.Services.Interfaces; | 38 | using OpenSim.Services.Interfaces; |
39 | using OpenMetaverse; | 39 | using OpenMetaverse; |
40 | 40 | ||
41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land | 41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MuteList |
42 | { | 42 | { |
43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LocalMuteListServicesConnector")] | 43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LocalMuteListServicesConnector")] |
44 | public class LocalMuteListServicesConnector : ISharedRegionModule, IMuteListService | 44 | public class LocalMuteListServicesConnector : ISharedRegionModule, IMuteListService |
@@ -66,7 +66,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land | |||
66 | 66 | ||
67 | public void Initialise(IConfigSource source) | 67 | public void Initialise(IConfigSource source) |
68 | { | 68 | { |
69 | IConfig moduleConfig = source.Configs["Modules"]; | 69 | // only active for core mute lists module |
70 | IConfig moduleConfig = source.Configs["Messaging"]; | ||
71 | if (moduleConfig == null) | ||
72 | return; | ||
73 | |||
74 | if (moduleConfig.GetString("MuteListModule", "None") != "MuteListModuleTst") | ||
75 | return; | ||
76 | |||
77 | moduleConfig = source.Configs["Modules"]; | ||
70 | 78 | ||
71 | if (moduleConfig == null) | 79 | if (moduleConfig == null) |
72 | return; | 80 | return; |
@@ -99,7 +107,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land | |||
99 | catch | 107 | catch |
100 | { | 108 | { |
101 | m_log.Error("[MuteList LOCALCONNECTOR]: Failed to load mute service"); | 109 | m_log.Error("[MuteList LOCALCONNECTOR]: Failed to load mute service"); |
102 | return; | 110 | return; |
103 | } | 111 | } |
104 | 112 | ||
105 | if (m_service == null) | 113 | if (m_service == null) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MuteList/RemoteMuteListServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MuteList/RemoteMuteListServiceConnector.cs new file mode 100644 index 0000000..a5dec64 --- /dev/null +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MuteList/RemoteMuteListServiceConnector.cs | |||
@@ -0,0 +1,143 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | using System; | ||
28 | using System.Collections.Generic; | ||
29 | using System.Reflection; | ||
30 | using OpenSim.Framework; | ||
31 | using OpenSim.Region.Framework.Interfaces; | ||
32 | using OpenSim.Region.Framework.Scenes; | ||
33 | using OpenSim.Server.Base; | ||
34 | using OpenSim.Services.Interfaces; | ||
35 | using OpenSim.Services.Connectors; | ||
36 | |||
37 | using OpenMetaverse; | ||
38 | using log4net; | ||
39 | using Mono.Addins; | ||
40 | using Nini.Config; | ||
41 | |||
42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MuteList | ||
43 | { | ||
44 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemoteMuteListServicesConnector")] | ||
45 | public class RemoteMuteListServicesConnector : ISharedRegionModule, IMuteListService | ||
46 | { | ||
47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
48 | |||
49 | #region ISharedRegionModule | ||
50 | |||
51 | private bool m_Enabled = false; | ||
52 | |||
53 | private IMuteListService m_remoteConnector; | ||
54 | |||
55 | public Type ReplaceableInterface | ||
56 | { | ||
57 | get { return null; } | ||
58 | } | ||
59 | |||
60 | public string Name | ||
61 | { | ||
62 | get { return "RemoteMuteListServicesConnector"; } | ||
63 | } | ||
64 | |||
65 | public void Initialise(IConfigSource source) | ||
66 | { | ||
67 | // only active for core mute lists module | ||
68 | IConfig moduleConfig = source.Configs["Messaging"]; | ||
69 | if (moduleConfig == null) | ||
70 | return; | ||
71 | |||
72 | if (moduleConfig.GetString("MuteListModule", "None") != "MuteListModuleTst") | ||
73 | return; | ||
74 | |||
75 | moduleConfig = source.Configs["Modules"]; | ||
76 | if (moduleConfig != null) | ||
77 | { | ||
78 | string name = moduleConfig.GetString("MuteListService", ""); | ||
79 | if (name == Name) | ||
80 | { | ||
81 | m_remoteConnector = new MuteListServicesConnector(source); | ||
82 | m_Enabled = true; | ||
83 | } | ||
84 | } | ||
85 | } | ||
86 | |||
87 | public void PostInitialise() | ||
88 | { | ||
89 | } | ||
90 | |||
91 | public void Close() | ||
92 | { | ||
93 | } | ||
94 | |||
95 | public void AddRegion(Scene scene) | ||
96 | { | ||
97 | if (!m_Enabled) | ||
98 | return; | ||
99 | |||
100 | scene.RegisterModuleInterface<IMuteListService>(this); | ||
101 | m_log.InfoFormat("[MUTELIST CONNECTOR]: Enabled for region {0}", scene.RegionInfo.RegionName); | ||
102 | } | ||
103 | |||
104 | public void RemoveRegion(Scene scene) | ||
105 | { | ||
106 | if (!m_Enabled) | ||
107 | return; | ||
108 | } | ||
109 | |||
110 | public void RegionLoaded(Scene scene) | ||
111 | { | ||
112 | if (!m_Enabled) | ||
113 | return; | ||
114 | } | ||
115 | |||
116 | #endregion | ||
117 | |||
118 | #region IMuteListService | ||
119 | public Byte[] MuteListRequest(UUID agentID, uint crc) | ||
120 | { | ||
121 | if (!m_Enabled) | ||
122 | return null; | ||
123 | return m_remoteConnector.MuteListRequest(agentID, crc); | ||
124 | } | ||
125 | |||
126 | public bool UpdateMute(MuteData mute) | ||
127 | { | ||
128 | if (!m_Enabled) | ||
129 | return false; | ||
130 | return m_remoteConnector.UpdateMute(mute); | ||
131 | } | ||
132 | |||
133 | public bool RemoveMute(UUID agentID, UUID muteID, string muteName) | ||
134 | { | ||
135 | if (!m_Enabled) | ||
136 | return false; | ||
137 | return m_remoteConnector.RemoveMute(agentID, muteID, muteName); | ||
138 | } | ||
139 | |||
140 | #endregion IMuteListService | ||
141 | |||
142 | } | ||
143 | } | ||