diff options
Merge branch 'ubitwork' of ssh://3dhosting.de/var/git/careminster into ubitwork
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut')
32 files changed, 432 insertions, 225 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs index 008465f..d221d68 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using log4net; | 28 | using log4net; |
29 | using Mono.Addins; | ||
29 | using Nini.Config; | 30 | using Nini.Config; |
30 | using System; | 31 | using System; |
31 | using System.Collections.Generic; | 32 | using System.Collections.Generic; |
@@ -40,8 +41,8 @@ using OpenMetaverse; | |||
40 | 41 | ||
41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | 42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset |
42 | { | 43 | { |
43 | public class HGAssetBroker : | 44 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "HGAssetBroker")] |
44 | ISharedRegionModule, IAssetService | 45 | public class HGAssetBroker : ISharedRegionModule, IAssetService |
45 | { | 46 | { |
46 | private static readonly ILog m_log = | 47 | private static readonly ILog m_log = |
47 | LogManager.GetLogger( | 48 | LogManager.GetLogger( |
@@ -56,6 +57,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
56 | 57 | ||
57 | private bool m_Enabled = false; | 58 | private bool m_Enabled = false; |
58 | 59 | ||
60 | private AssetPermissions m_AssetPerms; | ||
61 | |||
59 | public Type ReplaceableInterface | 62 | public Type ReplaceableInterface |
60 | { | 63 | { |
61 | get { return null; } | 64 | get { return null; } |
@@ -128,6 +131,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
128 | if (m_LocalAssetServiceURI != string.Empty) | 131 | if (m_LocalAssetServiceURI != string.Empty) |
129 | m_LocalAssetServiceURI = m_LocalAssetServiceURI.Trim('/'); | 132 | m_LocalAssetServiceURI = m_LocalAssetServiceURI.Trim('/'); |
130 | 133 | ||
134 | IConfig hgConfig = source.Configs["HGAssetService"]; | ||
135 | m_AssetPerms = new AssetPermissions(hgConfig); // it's ok if arg is null | ||
136 | |||
131 | m_Enabled = true; | 137 | m_Enabled = true; |
132 | m_log.Info("[HG ASSET CONNECTOR]: HG asset broker enabled"); | 138 | m_log.Info("[HG ASSET CONNECTOR]: HG asset broker enabled"); |
133 | } | 139 | } |
@@ -206,14 +212,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
206 | asset = m_HGService.Get(id); | 212 | asset = m_HGService.Get(id); |
207 | if (asset != null) | 213 | if (asset != null) |
208 | { | 214 | { |
209 | // Now store it locally | 215 | // Now store it locally, if allowed |
210 | // For now, let me just do it for textures and scripts | 216 | if (m_AssetPerms.AllowedImport(asset.Type)) |
211 | if (((AssetType)asset.Type == AssetType.Texture) || | ||
212 | ((AssetType)asset.Type == AssetType.LSLBytecode) || | ||
213 | ((AssetType)asset.Type == AssetType.LSLText)) | ||
214 | { | ||
215 | m_GridService.Store(asset); | 217 | m_GridService.Store(asset); |
216 | } | 218 | else |
219 | return null; | ||
217 | } | 220 | } |
218 | } | 221 | } |
219 | else | 222 | else |
@@ -328,7 +331,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
328 | 331 | ||
329 | string id = string.Empty; | 332 | string id = string.Empty; |
330 | if (IsHG(asset.ID)) | 333 | if (IsHG(asset.ID)) |
331 | id = m_HGService.Store(asset); | 334 | { |
335 | if (m_AssetPerms.AllowedExport(asset.Type)) | ||
336 | id = m_HGService.Store(asset); | ||
337 | else | ||
338 | return String.Empty; | ||
339 | } | ||
332 | else | 340 | else |
333 | id = m_GridService.Store(asset); | 341 | id = m_GridService.Store(asset); |
334 | 342 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs index c78915f..480cd69 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/LocalAssetServiceConnector.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using log4net; | 28 | using log4net; |
29 | using Mono.Addins; | ||
29 | using Nini.Config; | 30 | using Nini.Config; |
30 | using System; | 31 | using System; |
31 | using System.Collections.Generic; | 32 | using System.Collections.Generic; |
@@ -38,6 +39,7 @@ using OpenSim.Services.Interfaces; | |||
38 | 39 | ||
39 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | 40 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset |
40 | { | 41 | { |
42 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LocalAssetServicesConnector")] | ||
41 | public class LocalAssetServicesConnector : ISharedRegionModule, IAssetService | 43 | public class LocalAssetServicesConnector : ISharedRegionModule, IAssetService |
42 | { | 44 | { |
43 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -204,8 +206,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
204 | public byte[] GetData(string id) | 206 | public byte[] GetData(string id) |
205 | { | 207 | { |
206 | // m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Requesting data for asset {0}", id); | 208 | // m_log.DebugFormat("[LOCAL ASSET SERVICES CONNECTOR]: Requesting data for asset {0}", id); |
207 | 209 | ||
208 | AssetBase asset = m_Cache.Get(id); | 210 | AssetBase asset = null; |
211 | |||
212 | if (m_Cache != null) | ||
213 | asset = m_Cache.Get(id); | ||
209 | 214 | ||
210 | if (asset != null) | 215 | if (asset != null) |
211 | return asset.Data; | 216 | return asset.Data; |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/RemoteAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/RemoteAssetServiceConnector.cs index 8a22cfc..e6eeacf 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/RemoteAssetServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/RemoteAssetServiceConnector.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using log4net; | 28 | using log4net; |
29 | using Mono.Addins; | ||
29 | using System; | 30 | using System; |
30 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
31 | using System.Reflection; | 32 | using System.Reflection; |
@@ -38,6 +39,7 @@ using OpenSim.Services.Interfaces; | |||
38 | 39 | ||
39 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | 40 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset |
40 | { | 41 | { |
42 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemoteAssetServicesConnector")] | ||
41 | public class RemoteAssetServicesConnector : | 43 | public class RemoteAssetServicesConnector : |
42 | AssetServicesConnector, ISharedRegionModule, IAssetService | 44 | AssetServicesConnector, ISharedRegionModule, IAssetService |
43 | { | 45 | { |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/Tests/AssetConnectorTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/Tests/AssetConnectorTests.cs new file mode 100644 index 0000000..1982473 --- /dev/null +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/Tests/AssetConnectorTests.cs | |||
@@ -0,0 +1,136 @@ | |||
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 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.IO; | ||
31 | using System.Reflection; | ||
32 | using System.Threading; | ||
33 | using log4net.Config; | ||
34 | using Nini.Config; | ||
35 | using NUnit.Framework; | ||
36 | using OpenMetaverse; | ||
37 | using OpenSim.Framework; | ||
38 | using OpenSim.Region.Framework.Scenes; | ||
39 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset; | ||
40 | using OpenSim.Tests.Common; | ||
41 | |||
42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset.Tests | ||
43 | { | ||
44 | [TestFixture] | ||
45 | public class AssetConnectorsTests : OpenSimTestCase | ||
46 | { | ||
47 | [Test] | ||
48 | public void TestAddAsset() | ||
49 | { | ||
50 | TestHelpers.InMethod(); | ||
51 | // TestHelpers.EnableLogging(); | ||
52 | |||
53 | IConfigSource config = new IniConfigSource(); | ||
54 | config.AddConfig("Modules"); | ||
55 | config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector"); | ||
56 | config.AddConfig("AssetService"); | ||
57 | config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService"); | ||
58 | config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); | ||
59 | |||
60 | LocalAssetServicesConnector lasc = new LocalAssetServicesConnector(); | ||
61 | lasc.Initialise(config); | ||
62 | |||
63 | AssetBase a1 = AssetHelpers.CreateNotecardAsset(); | ||
64 | lasc.Store(a1); | ||
65 | |||
66 | AssetBase retreivedA1 = lasc.Get(a1.ID); | ||
67 | Assert.That(retreivedA1.ID, Is.EqualTo(a1.ID)); | ||
68 | Assert.That(retreivedA1.Metadata.ID, Is.EqualTo(a1.Metadata.ID)); | ||
69 | Assert.That(retreivedA1.Data.Length, Is.EqualTo(a1.Data.Length)); | ||
70 | |||
71 | AssetMetadata retrievedA1Metadata = lasc.GetMetadata(a1.ID); | ||
72 | Assert.That(retrievedA1Metadata.ID, Is.EqualTo(a1.ID)); | ||
73 | |||
74 | byte[] retrievedA1Data = lasc.GetData(a1.ID); | ||
75 | Assert.That(retrievedA1Data.Length, Is.EqualTo(a1.Data.Length)); | ||
76 | |||
77 | // TODO: Add cache and check that this does receive a copy of the asset | ||
78 | } | ||
79 | |||
80 | [Test] | ||
81 | public void TestAddTemporaryAsset() | ||
82 | { | ||
83 | TestHelpers.InMethod(); | ||
84 | // TestHelpers.EnableLogging(); | ||
85 | |||
86 | IConfigSource config = new IniConfigSource(); | ||
87 | config.AddConfig("Modules"); | ||
88 | config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector"); | ||
89 | config.AddConfig("AssetService"); | ||
90 | config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService"); | ||
91 | config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); | ||
92 | |||
93 | LocalAssetServicesConnector lasc = new LocalAssetServicesConnector(); | ||
94 | lasc.Initialise(config); | ||
95 | |||
96 | AssetBase a1 = AssetHelpers.CreateNotecardAsset(); | ||
97 | a1.Temporary = true; | ||
98 | |||
99 | lasc.Store(a1); | ||
100 | |||
101 | Assert.That(lasc.Get(a1.ID), Is.Null); | ||
102 | Assert.That(lasc.GetData(a1.ID), Is.Null); | ||
103 | Assert.That(lasc.GetMetadata(a1.ID), Is.Null); | ||
104 | |||
105 | // TODO: Add cache and check that this does receive a copy of the asset | ||
106 | } | ||
107 | |||
108 | [Test] | ||
109 | public void TestAddLocalAsset() | ||
110 | { | ||
111 | TestHelpers.InMethod(); | ||
112 | // TestHelpers.EnableLogging(); | ||
113 | |||
114 | IConfigSource config = new IniConfigSource(); | ||
115 | config.AddConfig("Modules"); | ||
116 | config.Configs["Modules"].Set("AssetServices", "LocalAssetServicesConnector"); | ||
117 | config.AddConfig("AssetService"); | ||
118 | config.Configs["AssetService"].Set("LocalServiceModule", "OpenSim.Services.AssetService.dll:AssetService"); | ||
119 | config.Configs["AssetService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); | ||
120 | |||
121 | LocalAssetServicesConnector lasc = new LocalAssetServicesConnector(); | ||
122 | lasc.Initialise(config); | ||
123 | |||
124 | AssetBase a1 = AssetHelpers.CreateNotecardAsset(); | ||
125 | a1.Local = true; | ||
126 | |||
127 | lasc.Store(a1); | ||
128 | |||
129 | Assert.That(lasc.Get(a1.ID), Is.Null); | ||
130 | Assert.That(lasc.GetData(a1.ID), Is.Null); | ||
131 | Assert.That(lasc.GetMetadata(a1.ID), Is.Null); | ||
132 | |||
133 | // TODO: Add cache and check that this does receive a copy of the asset | ||
134 | } | ||
135 | } | ||
136 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/LocalAuthenticationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/LocalAuthenticationServiceConnector.cs index d809ac2..f027810 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/LocalAuthenticationServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/LocalAuthenticationServiceConnector.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using log4net; | 31 | using log4net; |
32 | using Mono.Addins; | ||
32 | using Nini.Config; | 33 | using Nini.Config; |
33 | using OpenSim.Region.Framework.Interfaces; | 34 | using OpenSim.Region.Framework.Interfaces; |
34 | using OpenSim.Region.Framework.Scenes; | 35 | using OpenSim.Region.Framework.Scenes; |
@@ -39,6 +40,7 @@ using OpenMetaverse; | |||
39 | 40 | ||
40 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authentication | 41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authentication |
41 | { | 42 | { |
43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LocalAuthenticationServicesConnector")] | ||
42 | public class LocalAuthenticationServicesConnector : ISharedRegionModule, IAuthenticationService | 44 | public class LocalAuthenticationServicesConnector : ISharedRegionModule, IAuthenticationService |
43 | { | 45 | { |
44 | private static readonly ILog m_log = | 46 | private static readonly ILog m_log = |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/RemoteAuthenticationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/RemoteAuthenticationServiceConnector.cs index a053bc2..7cb8b22 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/RemoteAuthenticationServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authentication/RemoteAuthenticationServiceConnector.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using Nini.Config; | 29 | using Nini.Config; |
30 | using log4net; | 30 | using log4net; |
31 | using Mono.Addins; | ||
31 | using System.Reflection; | 32 | using System.Reflection; |
32 | using OpenSim.Region.Framework.Interfaces; | 33 | using OpenSim.Region.Framework.Interfaces; |
33 | using OpenSim.Region.Framework.Scenes; | 34 | using OpenSim.Region.Framework.Scenes; |
@@ -36,6 +37,7 @@ using OpenSim.Services.Connectors; | |||
36 | 37 | ||
37 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authentication | 38 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authentication |
38 | { | 39 | { |
40 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemoteAuthenticationServicesConnector")] | ||
39 | public class RemoteAuthenticationServicesConnector : AuthenticationServicesConnector, | 41 | public class RemoteAuthenticationServicesConnector : AuthenticationServicesConnector, |
40 | ISharedRegionModule, IAuthenticationService | 42 | ISharedRegionModule, IAuthenticationService |
41 | { | 43 | { |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs index 267fb9e..1acb695 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/LocalAuthorizationServiceConnector.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using log4net; | 28 | using log4net; |
29 | using Mono.Addins; | ||
29 | using Nini.Config; | 30 | using Nini.Config; |
30 | using System; | 31 | using System; |
31 | using System.Collections.Generic; | 32 | using System.Collections.Generic; |
@@ -39,6 +40,7 @@ using OpenMetaverse; | |||
39 | 40 | ||
40 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization | 41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization |
41 | { | 42 | { |
43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LocalAuthorizationServicesConnector")] | ||
42 | public class LocalAuthorizationServicesConnector : INonSharedRegionModule, IAuthorizationService | 44 | public class LocalAuthorizationServicesConnector : INonSharedRegionModule, IAuthorizationService |
43 | { | 45 | { |
44 | private static readonly ILog m_log = | 46 | private static readonly ILog m_log = |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs index 86c0099..b8d409d 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Authorization/RemoteAuthorizationServiceConnector.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using log4net; | 28 | using log4net; |
29 | using Mono.Addins; | ||
29 | using System; | 30 | using System; |
30 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
31 | using System.Reflection; | 32 | using System.Reflection; |
@@ -39,6 +40,7 @@ using OpenMetaverse; | |||
39 | 40 | ||
40 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization | 41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization |
41 | { | 42 | { |
43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemoteAuthorizationServicesConnector")] | ||
42 | public class RemoteAuthorizationServicesConnector : | 44 | public class RemoteAuthorizationServicesConnector : |
43 | AuthorizationServicesConnector, ISharedRegionModule, IAuthorizationService | 45 | AuthorizationServicesConnector, ISharedRegionModule, IAuthorizationService |
44 | { | 46 | { |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/LocalAvatarServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/LocalAvatarServiceConnector.cs index 9ee19f8..c3ef588 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/LocalAvatarServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/LocalAvatarServiceConnector.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using log4net; | 31 | using log4net; |
32 | using Mono.Addins; | ||
32 | using Nini.Config; | 33 | using Nini.Config; |
33 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
34 | using OpenSim.Region.Framework.Interfaces; | 35 | using OpenSim.Region.Framework.Interfaces; |
@@ -40,6 +41,7 @@ using OpenMetaverse; | |||
40 | 41 | ||
41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Avatar | 42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Avatar |
42 | { | 43 | { |
44 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LocalAvatarServicesConnector")] | ||
43 | public class LocalAvatarServicesConnector : ISharedRegionModule, IAvatarService | 45 | public class LocalAvatarServicesConnector : ISharedRegionModule, IAvatarService |
44 | { | 46 | { |
45 | private static readonly ILog m_log = | 47 | private static readonly ILog m_log = |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/RemoteAvatarServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/RemoteAvatarServiceConnector.cs index d665a54..a087aea 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/RemoteAvatarServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Avatar/RemoteAvatarServiceConnector.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using Mono.Addins; | ||
29 | using Nini.Config; | 30 | using Nini.Config; |
30 | using log4net; | 31 | using log4net; |
31 | using System.Reflection; | 32 | using System.Reflection; |
@@ -36,6 +37,7 @@ using OpenSim.Services.Connectors; | |||
36 | 37 | ||
37 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Avatar | 38 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Avatar |
38 | { | 39 | { |
40 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemoteAvatarServicesConnector")] | ||
39 | public class RemoteAvatarServicesConnector : AvatarServicesConnector, | 41 | public class RemoteAvatarServicesConnector : AvatarServicesConnector, |
40 | ISharedRegionModule, IAvatarService | 42 | ISharedRegionModule, IAvatarService |
41 | { | 43 | { |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs index 3c6e381..c0c2ca7 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using log4net; | 28 | using log4net; |
29 | using Mono.Addins; | ||
29 | using Nini.Config; | 30 | using Nini.Config; |
30 | using System; | 31 | using System; |
31 | using System.Collections.Generic; | 32 | using System.Collections.Generic; |
@@ -41,6 +42,7 @@ using OpenMetaverse; | |||
41 | 42 | ||
42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | 43 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid |
43 | { | 44 | { |
45 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LocalGridServicesConnector")] | ||
44 | public class LocalGridServicesConnector : ISharedRegionModule, IGridService | 46 | public class LocalGridServicesConnector : ISharedRegionModule, IGridService |
45 | { | 47 | { |
46 | private static readonly ILog m_log = | 48 | private static readonly ILog m_log = |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs index e6c89d7..b2646ba 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RemoteGridServiceConnector.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using log4net; | 28 | using log4net; |
29 | using Mono.Addins; | ||
29 | using System; | 30 | using System; |
30 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
31 | using System.Reflection; | 32 | using System.Reflection; |
@@ -42,6 +43,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; | |||
42 | 43 | ||
43 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid | 44 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid |
44 | { | 45 | { |
46 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemoteGridServicesConnector")] | ||
45 | public class RemoteGridServicesConnector : ISharedRegionModule, IGridService | 47 | public class RemoteGridServicesConnector : ISharedRegionModule, IGridService |
46 | { | 48 | { |
47 | private static readonly ILog m_log = | 49 | private static readonly ILog m_log = |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs index b286d17..4338133 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs | |||
@@ -43,11 +43,15 @@ using OpenSim.Tests.Common; | |||
43 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests | 43 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests |
44 | { | 44 | { |
45 | [TestFixture] | 45 | [TestFixture] |
46 | public class GridConnectorsTests | 46 | public class GridConnectorsTests : OpenSimTestCase |
47 | { | 47 | { |
48 | LocalGridServicesConnector m_LocalConnector; | 48 | LocalGridServicesConnector m_LocalConnector; |
49 | private void SetUp() | 49 | |
50 | [SetUp] | ||
51 | public override void SetUp() | ||
50 | { | 52 | { |
53 | base.SetUp(); | ||
54 | |||
51 | IConfigSource config = new IniConfigSource(); | 55 | IConfigSource config = new IniConfigSource(); |
52 | config.AddConfig("Modules"); | 56 | config.AddConfig("Modules"); |
53 | config.AddConfig("GridService"); | 57 | config.AddConfig("GridService"); |
@@ -71,8 +75,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests | |||
71 | TestHelpers.InMethod(); | 75 | TestHelpers.InMethod(); |
72 | // log4net.Config.XmlConfigurator.Configure(); | 76 | // log4net.Config.XmlConfigurator.Configure(); |
73 | 77 | ||
74 | SetUp(); | ||
75 | |||
76 | // Create 4 regions | 78 | // Create 4 regions |
77 | GridRegion r1 = new GridRegion(); | 79 | GridRegion r1 = new GridRegion(); |
78 | r1.RegionName = "Test Region 1"; | 80 | r1.RegionName = "Test Region 1"; |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs index b0edce7..221f815 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/ActivityDetector.cs | |||
@@ -65,11 +65,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser | |||
65 | 65 | ||
66 | public void OnMakeRootAgent(ScenePresence sp) | 66 | public void OnMakeRootAgent(ScenePresence sp) |
67 | { | 67 | { |
68 | // m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected root presence {0} in {1}", sp.UUID, sp.Scene.RegionInfo.RegionName); | ||
69 | |||
70 | if (sp.PresenceType != PresenceType.Npc) | 68 | if (sp.PresenceType != PresenceType.Npc) |
69 | { | ||
70 | string userid = sp.Scene.UserManagementModule.GetUserUUI(sp.UUID); | ||
71 | //m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected root presence {0} in {1}", userid, sp.Scene.RegionInfo.RegionName); | ||
71 | m_GridUserService.SetLastPosition( | 72 | m_GridUserService.SetLastPosition( |
72 | sp.UUID.ToString(), UUID.Zero, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); | 73 | userid, UUID.Zero, sp.Scene.RegionInfo.RegionID, sp.AbsolutePosition, sp.Lookat); |
74 | } | ||
73 | } | 75 | } |
74 | 76 | ||
75 | public void OnNewClient(IClientAPI client) | 77 | public void OnNewClient(IClientAPI client) |
@@ -82,9 +84,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser | |||
82 | if (client.SceneAgent.IsChildAgent) | 84 | if (client.SceneAgent.IsChildAgent) |
83 | return; | 85 | return; |
84 | 86 | ||
85 | // m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); | 87 | string userId = client.AgentId.ToString(); |
88 | if (client.Scene is Scene) | ||
89 | { | ||
90 | Scene s = (Scene)client.Scene; | ||
91 | userId = s.UserManagementModule.GetUserUUI(client.AgentId); | ||
92 | } | ||
93 | //m_log.DebugFormat("[ACTIVITY DETECTOR]: Detected client logout {0} in {1}", userId, client.Scene.RegionInfo.RegionName); | ||
94 | |||
86 | m_GridUserService.LoggedOut( | 95 | m_GridUserService.LoggedOut( |
87 | client.AgentId.ToString(), client.SessionId, client.Scene.RegionInfo.RegionID, | 96 | userId, client.SessionId, client.Scene.RegionInfo.RegionID, |
88 | client.SceneAgent.AbsolutePosition, client.SceneAgent.Lookat); | 97 | client.SceneAgent.AbsolutePosition, client.SceneAgent.Lookat); |
89 | } | 98 | } |
90 | } | 99 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs index 90fe69e..5734334 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/LocalGridUserServiceConnector.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using log4net; | 31 | using log4net; |
32 | using Mono.Addins; | ||
32 | using Nini.Config; | 33 | using Nini.Config; |
33 | using OpenSim.Region.Framework.Interfaces; | 34 | using OpenSim.Region.Framework.Interfaces; |
34 | using OpenSim.Region.Framework.Scenes; | 35 | using OpenSim.Region.Framework.Scenes; |
@@ -39,6 +40,7 @@ using OpenMetaverse; | |||
39 | 40 | ||
40 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser | 41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser |
41 | { | 42 | { |
43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LocalGridUserServicesConnector")] | ||
42 | public class LocalGridUserServicesConnector : ISharedRegionModule, IGridUserService | 44 | public class LocalGridUserServicesConnector : ISharedRegionModule, IGridUserService |
43 | { | 45 | { |
44 | private static readonly ILog m_log = | 46 | private static readonly ILog m_log = |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs index badb552..f7e6eb8 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/GridUser/RemoteGridUserServiceConnector.cs | |||
@@ -36,14 +36,19 @@ using OpenSim.Services.Connectors; | |||
36 | 36 | ||
37 | using OpenMetaverse; | 37 | using OpenMetaverse; |
38 | using log4net; | 38 | using log4net; |
39 | using Mono.Addins; | ||
39 | using Nini.Config; | 40 | using Nini.Config; |
40 | 41 | ||
41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser | 42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser |
42 | { | 43 | { |
44 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemoteGridUserServicesConnector")] | ||
43 | public class RemoteGridUserServicesConnector : ISharedRegionModule, IGridUserService | 45 | public class RemoteGridUserServicesConnector : ISharedRegionModule, IGridUserService |
44 | { | 46 | { |
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 47 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 48 | ||
49 | private const int KEEPTIME = 30; // 30 secs | ||
50 | private ExpiringCache<string, GridUserInfo> m_Infos = new ExpiringCache<string, GridUserInfo>(); | ||
51 | |||
47 | #region ISharedRegionModule | 52 | #region ISharedRegionModule |
48 | 53 | ||
49 | private bool m_Enabled = false; | 54 | private bool m_Enabled = false; |
@@ -128,23 +133,60 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.GridUser | |||
128 | 133 | ||
129 | public bool LoggedOut(string userID, UUID sessionID, UUID region, Vector3 position, Vector3 lookat) | 134 | public bool LoggedOut(string userID, UUID sessionID, UUID region, Vector3 position, Vector3 lookat) |
130 | { | 135 | { |
136 | if (m_Infos.Contains(userID)) | ||
137 | m_Infos.Remove(userID); | ||
138 | |||
131 | return m_RemoteConnector.LoggedOut(userID, sessionID, region, position, lookat); | 139 | return m_RemoteConnector.LoggedOut(userID, sessionID, region, position, lookat); |
132 | } | 140 | } |
133 | 141 | ||
134 | 142 | ||
135 | public bool SetHome(string userID, UUID regionID, Vector3 position, Vector3 lookAt) | 143 | public bool SetHome(string userID, UUID regionID, Vector3 position, Vector3 lookAt) |
136 | { | 144 | { |
137 | return m_RemoteConnector.SetHome(userID, regionID, position, lookAt); | 145 | if (m_RemoteConnector.SetHome(userID, regionID, position, lookAt)) |
146 | { | ||
147 | // Update the cache too | ||
148 | GridUserInfo info = null; | ||
149 | if (m_Infos.TryGetValue(userID, out info)) | ||
150 | { | ||
151 | info.HomeRegionID = regionID; | ||
152 | info.HomePosition = position; | ||
153 | info.HomeLookAt = lookAt; | ||
154 | } | ||
155 | return true; | ||
156 | } | ||
157 | |||
158 | return false; | ||
138 | } | 159 | } |
139 | 160 | ||
140 | public bool SetLastPosition(string userID, UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt) | 161 | public bool SetLastPosition(string userID, UUID sessionID, UUID regionID, Vector3 position, Vector3 lookAt) |
141 | { | 162 | { |
142 | return m_RemoteConnector.SetLastPosition(userID, sessionID, regionID, position, lookAt); | 163 | if (m_RemoteConnector.SetLastPosition(userID, sessionID, regionID, position, lookAt)) |
164 | { | ||
165 | // Update the cache too | ||
166 | GridUserInfo info = null; | ||
167 | if (m_Infos.TryGetValue(userID, out info)) | ||
168 | { | ||
169 | info.LastRegionID = regionID; | ||
170 | info.LastPosition = position; | ||
171 | info.LastLookAt = lookAt; | ||
172 | } | ||
173 | return true; | ||
174 | } | ||
175 | |||
176 | return false; | ||
143 | } | 177 | } |
144 | 178 | ||
145 | public GridUserInfo GetGridUserInfo(string userID) | 179 | public GridUserInfo GetGridUserInfo(string userID) |
146 | { | 180 | { |
147 | return m_RemoteConnector.GetGridUserInfo(userID); | 181 | GridUserInfo info = null; |
182 | if (m_Infos.TryGetValue(userID, out info)) | ||
183 | return info; | ||
184 | |||
185 | info = m_RemoteConnector.GetGridUserInfo(userID); | ||
186 | |||
187 | m_Infos.AddOrUpdate(userID, info, KEEPTIME); | ||
188 | |||
189 | return info; | ||
148 | } | 190 | } |
149 | 191 | ||
150 | public GridUserInfo[] GetGridUserInfo(string[] userID) | 192 | public GridUserInfo[] GetGridUserInfo(string[] userID) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index cf6d2f7..e474ef6 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using log4net; | 28 | using log4net; |
29 | using Mono.Addins; | ||
29 | using Nini.Config; | 30 | using Nini.Config; |
30 | using System; | 31 | using System; |
31 | using System.Collections.Generic; | 32 | using System.Collections.Generic; |
@@ -42,6 +43,7 @@ using OpenMetaverse; | |||
42 | 43 | ||
43 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | 44 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory |
44 | { | 45 | { |
46 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "HGInventoryBroker")] | ||
45 | public class HGInventoryBroker : ISharedRegionModule, IInventoryService | 47 | public class HGInventoryBroker : ISharedRegionModule, IInventoryService |
46 | { | 48 | { |
47 | private static readonly ILog m_log = | 49 | private static readonly ILog m_log = |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs index 097ff1a..ec5751d 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using log4net; | 28 | using log4net; |
29 | using Mono.Addins; | ||
29 | using Nini.Config; | 30 | using Nini.Config; |
30 | 31 | ||
31 | using System; | 32 | using System; |
@@ -41,6 +42,7 @@ using OpenMetaverse; | |||
41 | 42 | ||
42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | 43 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory |
43 | { | 44 | { |
45 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LocalInventoryServicesConnector")] | ||
44 | public class LocalInventoryServicesConnector : ISharedRegionModule, IInventoryService | 46 | public class LocalInventoryServicesConnector : ISharedRegionModule, IInventoryService |
45 | { | 47 | { |
46 | private static readonly ILog m_log = | 48 | private static readonly ILog m_log = |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs index 11e0150..2d3ba82 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs | |||
@@ -29,6 +29,7 @@ using log4net; | |||
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using Mono.Addins; | ||
32 | using Nini.Config; | 33 | using Nini.Config; |
33 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Monitoring; | 35 | using OpenSim.Framework.Monitoring; |
@@ -40,6 +41,7 @@ using OpenMetaverse; | |||
40 | 41 | ||
41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | 42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory |
42 | { | 43 | { |
44 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemoteXInventoryServicesConnector")] | ||
43 | public class RemoteXInventoryServicesConnector : ISharedRegionModule, IInventoryService | 45 | public class RemoteXInventoryServicesConnector : ISharedRegionModule, IInventoryService |
44 | { | 46 | { |
45 | private static readonly ILog m_log = | 47 | private static readonly ILog m_log = |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs index 86c0b85..5329933 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/LocalLandServiceConnector.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using log4net; | 28 | using log4net; |
29 | using Mono.Addins; | ||
29 | using Nini.Config; | 30 | using Nini.Config; |
30 | using System; | 31 | using System; |
31 | using System.Collections.Generic; | 32 | using System.Collections.Generic; |
@@ -39,8 +40,8 @@ using OpenMetaverse; | |||
39 | 40 | ||
40 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land | 41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land |
41 | { | 42 | { |
42 | public class LocalLandServicesConnector : | 43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LocalLandServicesConnector")] |
43 | ISharedRegionModule, ILandService | 44 | public class LocalLandServicesConnector : ISharedRegionModule, ILandService |
44 | { | 45 | { |
45 | private static readonly ILog m_log = | 46 | private static readonly ILog m_log = |
46 | LogManager.GetLogger( | 47 | LogManager.GetLogger( |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs index 766ef81..77dfa4a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Land/RemoteLandServiceConnector.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using log4net; | 28 | using log4net; |
29 | using Mono.Addins; | ||
29 | using System; | 30 | using System; |
30 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
31 | using System.Reflection; | 32 | using System.Reflection; |
@@ -41,6 +42,7 @@ using OpenMetaverse; | |||
41 | 42 | ||
42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land | 43 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Land |
43 | { | 44 | { |
45 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemoteLandServicesConnector")] | ||
44 | public class RemoteLandServicesConnector : | 46 | public class RemoteLandServicesConnector : |
45 | LandServicesConnector, ISharedRegionModule, ILandService | 47 | LandServicesConnector, ISharedRegionModule, ILandService |
46 | { | 48 | { |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs index e4c6c1a..5836eb9 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs | |||
@@ -52,7 +52,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
52 | /// <remarks> | 52 | /// <remarks> |
53 | /// </remarks> | 53 | /// </remarks> |
54 | 54 | ||
55 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 55 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "MapImageServiceModule")] |
56 | public class MapImageServiceModule : ISharedRegionModule | 56 | public class MapImageServiceModule : ISharedRegionModule |
57 | { | 57 | { |
58 | private static readonly ILog m_log = | 58 | private static readonly ILog m_log = |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs index 7a90686..fd89428 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/LocalNeighbourServiceConnector.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using log4net; | 31 | using log4net; |
32 | using Mono.Addins; | ||
32 | using Nini.Config; | 33 | using Nini.Config; |
33 | using OpenMetaverse; | 34 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
@@ -39,6 +40,7 @@ using OpenSim.Services.Interfaces; | |||
39 | 40 | ||
40 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour | 41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour |
41 | { | 42 | { |
43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LocalNeighbourServicesConnector")] | ||
42 | public class LocalNeighbourServicesConnector : | 44 | public class LocalNeighbourServicesConnector : |
43 | ISharedRegionModule, INeighbourService | 45 | ISharedRegionModule, INeighbourService |
44 | { | 46 | { |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/RemoteNeighourServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/RemoteNeighourServiceConnector.cs index c6fc2a1..e6772f3 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/RemoteNeighourServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Neighbour/RemoteNeighourServiceConnector.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using log4net; | 28 | using log4net; |
29 | using Mono.Addins; | ||
29 | using System; | 30 | using System; |
30 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
31 | using System.Reflection; | 32 | using System.Reflection; |
@@ -39,6 +40,7 @@ using OpenSim.Server.Base; | |||
39 | 40 | ||
40 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour | 41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour |
41 | { | 42 | { |
43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemoteNeighbourServicesConnector")] | ||
42 | public class RemoteNeighbourServicesConnector : | 44 | public class RemoteNeighbourServicesConnector : |
43 | NeighbourServicesConnector, ISharedRegionModule, INeighbourService | 45 | NeighbourServicesConnector, ISharedRegionModule, INeighbourService |
44 | { | 46 | { |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/BasePresenceServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/BasePresenceServiceConnector.cs new file mode 100644 index 0000000..fdbe10a --- /dev/null +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/BasePresenceServiceConnector.cs | |||
@@ -0,0 +1,137 @@ | |||
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 | |||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Reflection; | ||
31 | using log4net; | ||
32 | using Mono.Addins; | ||
33 | using Nini.Config; | ||
34 | using OpenMetaverse; | ||
35 | using OpenSim.Region.Framework.Interfaces; | ||
36 | using OpenSim.Region.Framework.Scenes; | ||
37 | using OpenSim.Server.Base; | ||
38 | using OpenSim.Services.Interfaces; | ||
39 | using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo; | ||
40 | |||
41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence | ||
42 | { | ||
43 | public class BasePresenceServiceConnector : IPresenceService | ||
44 | { | ||
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
46 | |||
47 | protected bool m_Enabled; | ||
48 | |||
49 | protected PresenceDetector m_PresenceDetector; | ||
50 | |||
51 | /// <summary> | ||
52 | /// Underlying presence service. Do not use directly. | ||
53 | /// </summary> | ||
54 | public IPresenceService m_PresenceService; | ||
55 | |||
56 | public Type ReplaceableInterface | ||
57 | { | ||
58 | get { return null; } | ||
59 | } | ||
60 | |||
61 | public void AddRegion(Scene scene) | ||
62 | { | ||
63 | if (!m_Enabled) | ||
64 | return; | ||
65 | |||
66 | // m_log.DebugFormat( | ||
67 | // "[LOCAL PRESENCE CONNECTOR]: Registering IPresenceService to scene {0}", scene.RegionInfo.RegionName); | ||
68 | |||
69 | scene.RegisterModuleInterface<IPresenceService>(this); | ||
70 | m_PresenceDetector.AddRegion(scene); | ||
71 | |||
72 | m_log.InfoFormat("[BASE PRESENCE SERVICE CONNECTOR]: Enabled for region {0}", scene.Name); | ||
73 | } | ||
74 | |||
75 | public void RemoveRegion(Scene scene) | ||
76 | { | ||
77 | if (!m_Enabled) | ||
78 | return; | ||
79 | |||
80 | m_PresenceDetector.RemoveRegion(scene); | ||
81 | } | ||
82 | |||
83 | public void RegionLoaded(Scene scene) | ||
84 | { | ||
85 | if (!m_Enabled) | ||
86 | return; | ||
87 | |||
88 | } | ||
89 | |||
90 | public void PostInitialise() | ||
91 | { | ||
92 | } | ||
93 | |||
94 | public void Close() | ||
95 | { | ||
96 | } | ||
97 | |||
98 | #region IPresenceService | ||
99 | |||
100 | public bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID) | ||
101 | { | ||
102 | m_log.Warn("[BASE PRESENCE SERVICE CONNECTOR]: LoginAgent connector not implemented at the simulators"); | ||
103 | return false; | ||
104 | } | ||
105 | |||
106 | public bool LogoutAgent(UUID sessionID) | ||
107 | { | ||
108 | return m_PresenceService.LogoutAgent(sessionID); | ||
109 | } | ||
110 | |||
111 | public bool LogoutRegionAgents(UUID regionID) | ||
112 | { | ||
113 | return m_PresenceService.LogoutRegionAgents(regionID); | ||
114 | } | ||
115 | |||
116 | public bool ReportAgent(UUID sessionID, UUID regionID) | ||
117 | { | ||
118 | return m_PresenceService.ReportAgent(sessionID, regionID); | ||
119 | } | ||
120 | |||
121 | public PresenceInfo GetAgent(UUID sessionID) | ||
122 | { | ||
123 | return m_PresenceService.GetAgent(sessionID); | ||
124 | } | ||
125 | |||
126 | public PresenceInfo[] GetAgents(string[] userIDs) | ||
127 | { | ||
128 | // Don't bother potentially making a useless network call if we not going to ask for any users anyway. | ||
129 | if (userIDs.Length == 0) | ||
130 | return new PresenceInfo[0]; | ||
131 | |||
132 | return m_PresenceService.GetAgents(userIDs); | ||
133 | } | ||
134 | |||
135 | #endregion | ||
136 | } | ||
137 | } \ No newline at end of file | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs index 49dd633..db5c520 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/LocalPresenceServiceConnector.cs | |||
@@ -24,51 +24,29 @@ | |||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 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. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | |||
27 | using System; | 28 | using System; |
28 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
29 | using System.Reflection; | 30 | using System.Reflection; |
30 | 31 | using log4net; | |
32 | using Mono.Addins; | ||
33 | using Nini.Config; | ||
34 | using OpenMetaverse; | ||
31 | using OpenSim.Region.Framework.Interfaces; | 35 | using OpenSim.Region.Framework.Interfaces; |
32 | using OpenSim.Region.Framework.Scenes; | 36 | using OpenSim.Region.Framework.Scenes; |
33 | using OpenSim.Server.Base; | 37 | using OpenSim.Server.Base; |
34 | using OpenSim.Services.Interfaces; | 38 | using OpenSim.Services.Interfaces; |
35 | using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo; | 39 | using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo; |
36 | 40 | ||
37 | using OpenMetaverse; | ||
38 | using log4net; | ||
39 | using Nini.Config; | ||
40 | |||
41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence | 41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence |
42 | { | 42 | { |
43 | public class LocalPresenceServicesConnector : ISharedRegionModule, IPresenceService | 43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LocalPresenceServicesConnector")] |
44 | public class LocalPresenceServicesConnector : BasePresenceServiceConnector, ISharedRegionModule, IPresenceService | ||
44 | { | 45 | { |
45 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
46 | 47 | ||
47 | private bool m_Enabled = false; | ||
48 | |||
49 | private PresenceDetector m_PresenceDetector; | ||
50 | |||
51 | /// <summary> | ||
52 | /// Underlying presence service. Do not use directly. | ||
53 | /// </summary> | ||
54 | public IPresenceService m_PresenceService; | ||
55 | |||
56 | public LocalPresenceServicesConnector() | ||
57 | { | ||
58 | } | ||
59 | |||
60 | public LocalPresenceServicesConnector(IConfigSource source) | ||
61 | { | ||
62 | Initialise(source); | ||
63 | } | ||
64 | |||
65 | #region ISharedRegionModule | 48 | #region ISharedRegionModule |
66 | 49 | ||
67 | public Type ReplaceableInterface | ||
68 | { | ||
69 | get { return null; } | ||
70 | } | ||
71 | |||
72 | public string Name | 50 | public string Name |
73 | { | 51 | { |
74 | get { return "LocalPresenceServicesConnector"; } | 52 | get { return "LocalPresenceServicesConnector"; } |
@@ -119,81 +97,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence | |||
119 | } | 97 | } |
120 | } | 98 | } |
121 | 99 | ||
122 | public void PostInitialise() | ||
123 | { | ||
124 | } | ||
125 | |||
126 | public void Close() | ||
127 | { | ||
128 | } | ||
129 | |||
130 | public void AddRegion(Scene scene) | ||
131 | { | ||
132 | if (!m_Enabled) | ||
133 | return; | ||
134 | |||
135 | // m_log.DebugFormat( | ||
136 | // "[LOCAL PRESENCE CONNECTOR]: Registering IPresenceService to scene {0}", scene.RegionInfo.RegionName); | ||
137 | |||
138 | scene.RegisterModuleInterface<IPresenceService>(this); | ||
139 | m_PresenceDetector.AddRegion(scene); | ||
140 | |||
141 | m_log.InfoFormat("[LOCAL PRESENCE CONNECTOR]: Enabled local presence for region {0}", scene.RegionInfo.RegionName); | ||
142 | |||
143 | } | ||
144 | |||
145 | public void RemoveRegion(Scene scene) | ||
146 | { | ||
147 | if (!m_Enabled) | ||
148 | return; | ||
149 | |||
150 | m_PresenceDetector.RemoveRegion(scene); | ||
151 | } | ||
152 | |||
153 | public void RegionLoaded(Scene scene) | ||
154 | { | ||
155 | if (!m_Enabled) | ||
156 | return; | ||
157 | |||
158 | } | ||
159 | |||
160 | #endregion | ||
161 | |||
162 | #region IPresenceService | ||
163 | |||
164 | public bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID) | ||
165 | { | ||
166 | m_log.Warn("[LOCAL PRESENCE CONNECTOR]: LoginAgent connector not implemented at the simulators"); | ||
167 | return false; | ||
168 | } | ||
169 | |||
170 | public bool LogoutAgent(UUID sessionID) | ||
171 | { | ||
172 | return m_PresenceService.LogoutAgent(sessionID); | ||
173 | } | ||
174 | |||
175 | |||
176 | public bool LogoutRegionAgents(UUID regionID) | ||
177 | { | ||
178 | return m_PresenceService.LogoutRegionAgents(regionID); | ||
179 | } | ||
180 | |||
181 | public bool ReportAgent(UUID sessionID, UUID regionID) | ||
182 | { | ||
183 | return m_PresenceService.ReportAgent(sessionID, regionID); | ||
184 | } | ||
185 | |||
186 | public PresenceInfo GetAgent(UUID sessionID) | ||
187 | { | ||
188 | return m_PresenceService.GetAgent(sessionID); | ||
189 | } | ||
190 | |||
191 | public PresenceInfo[] GetAgents(string[] userIDs) | ||
192 | { | ||
193 | return m_PresenceService.GetAgents(userIDs); | ||
194 | } | ||
195 | |||
196 | #endregion | 100 | #endregion |
197 | |||
198 | } | 101 | } |
199 | } | 102 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs index bf4e9ab..6ca5c28 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs | |||
@@ -37,26 +37,18 @@ using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo; | |||
37 | 37 | ||
38 | using OpenMetaverse; | 38 | using OpenMetaverse; |
39 | using log4net; | 39 | using log4net; |
40 | using Mono.Addins; | ||
40 | using Nini.Config; | 41 | using Nini.Config; |
41 | 42 | ||
42 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence | 43 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence |
43 | { | 44 | { |
44 | public class RemotePresenceServicesConnector : ISharedRegionModule, IPresenceService | 45 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemotePresenceServicesConnector")] |
46 | public class RemotePresenceServicesConnector : BasePresenceServiceConnector, ISharedRegionModule | ||
45 | { | 47 | { |
46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 48 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
47 | 49 | ||
48 | #region ISharedRegionModule | 50 | #region ISharedRegionModule |
49 | 51 | ||
50 | private bool m_Enabled = false; | ||
51 | |||
52 | private PresenceDetector m_PresenceDetector; | ||
53 | private IPresenceService m_RemoteConnector; | ||
54 | |||
55 | public Type ReplaceableInterface | ||
56 | { | ||
57 | get { return null; } | ||
58 | } | ||
59 | |||
60 | public string Name | 52 | public string Name |
61 | { | 53 | { |
62 | get { return "RemotePresenceServicesConnector"; } | 54 | get { return "RemotePresenceServicesConnector"; } |
@@ -70,7 +62,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence | |||
70 | string name = moduleConfig.GetString("PresenceServices", ""); | 62 | string name = moduleConfig.GetString("PresenceServices", ""); |
71 | if (name == Name) | 63 | if (name == Name) |
72 | { | 64 | { |
73 | m_RemoteConnector = new PresenceServicesConnector(source); | 65 | m_PresenceService = new PresenceServicesConnector(source); |
74 | 66 | ||
75 | m_Enabled = true; | 67 | m_Enabled = true; |
76 | 68 | ||
@@ -79,81 +71,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence | |||
79 | m_log.Info("[REMOTE PRESENCE CONNECTOR]: Remote presence enabled"); | 71 | m_log.Info("[REMOTE PRESENCE CONNECTOR]: Remote presence enabled"); |
80 | } | 72 | } |
81 | } | 73 | } |
82 | |||
83 | } | ||
84 | |||
85 | public void PostInitialise() | ||
86 | { | ||
87 | } | ||
88 | |||
89 | public void Close() | ||
90 | { | ||
91 | } | ||
92 | |||
93 | public void AddRegion(Scene scene) | ||
94 | { | ||
95 | if (!m_Enabled) | ||
96 | return; | ||
97 | |||
98 | scene.RegisterModuleInterface<IPresenceService>(this); | ||
99 | m_PresenceDetector.AddRegion(scene); | ||
100 | |||
101 | m_log.InfoFormat("[REMOTE PRESENCE CONNECTOR]: Enabled remote presence for region {0}", scene.RegionInfo.RegionName); | ||
102 | |||
103 | } | ||
104 | |||
105 | public void RemoveRegion(Scene scene) | ||
106 | { | ||
107 | if (!m_Enabled) | ||
108 | return; | ||
109 | |||
110 | m_PresenceDetector.RemoveRegion(scene); | ||
111 | } | ||
112 | |||
113 | public void RegionLoaded(Scene scene) | ||
114 | { | ||
115 | if (!m_Enabled) | ||
116 | return; | ||
117 | |||
118 | } | ||
119 | |||
120 | #endregion | ||
121 | |||
122 | #region IPresenceService | ||
123 | |||
124 | public bool LoginAgent(string userID, UUID sessionID, UUID secureSessionID) | ||
125 | { | ||
126 | m_log.Warn("[REMOTE PRESENCE CONNECTOR]: LoginAgent connector not implemented at the simulators"); | ||
127 | return false; | ||
128 | } | ||
129 | |||
130 | public bool LogoutAgent(UUID sessionID) | ||
131 | { | ||
132 | return m_RemoteConnector.LogoutAgent(sessionID); | ||
133 | } | ||
134 | |||
135 | |||
136 | public bool LogoutRegionAgents(UUID regionID) | ||
137 | { | ||
138 | return m_RemoteConnector.LogoutRegionAgents(regionID); | ||
139 | } | ||
140 | |||
141 | public bool ReportAgent(UUID sessionID, UUID regionID) | ||
142 | { | ||
143 | return m_RemoteConnector.ReportAgent(sessionID, regionID); | ||
144 | } | ||
145 | |||
146 | public PresenceInfo GetAgent(UUID sessionID) | ||
147 | { | ||
148 | return m_RemoteConnector.GetAgent(sessionID); | ||
149 | } | ||
150 | |||
151 | public PresenceInfo[] GetAgents(string[] userIDs) | ||
152 | { | ||
153 | return m_RemoteConnector.GetAgents(userIDs); | ||
154 | } | 74 | } |
155 | 75 | ||
156 | #endregion | 76 | #endregion |
157 | |||
158 | } | 77 | } |
159 | } | 78 | } \ No newline at end of file |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs index 4556df3..32e47f9 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/Tests/PresenceConnectorsTests.cs | |||
@@ -56,7 +56,8 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence.Tests | |||
56 | config.Configs["PresenceService"].Set("LocalServiceModule", "OpenSim.Services.PresenceService.dll:PresenceService"); | 56 | config.Configs["PresenceService"].Set("LocalServiceModule", "OpenSim.Services.PresenceService.dll:PresenceService"); |
57 | config.Configs["PresenceService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); | 57 | config.Configs["PresenceService"].Set("StorageProvider", "OpenSim.Data.Null.dll"); |
58 | 58 | ||
59 | m_LocalConnector = new LocalPresenceServicesConnector(config); | 59 | m_LocalConnector = new LocalPresenceServicesConnector(); |
60 | m_LocalConnector.Initialise(config); | ||
60 | 61 | ||
61 | // Let's stick in a test presence | 62 | // Let's stick in a test presence |
62 | m_LocalConnector.m_PresenceService.LoginAgent(UUID.Zero.ToString(), UUID.Zero, UUID.Zero); | 63 | m_LocalConnector.m_PresenceService.LoginAgent(UUID.Zero.ToString(), UUID.Zero, UUID.Zero); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index 6eb99ea..b485194 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | |||
@@ -29,6 +29,7 @@ using System.Collections.Generic; | |||
29 | using System.Linq; | 29 | using System.Linq; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using log4net; | 31 | using log4net; |
32 | using Mono.Addins; | ||
32 | using Nini.Config; | 33 | using Nini.Config; |
33 | using OpenMetaverse; | 34 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
@@ -39,6 +40,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; | |||
39 | 40 | ||
40 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | 41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation |
41 | { | 42 | { |
43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LocalSimulationConnectorModule")] | ||
42 | public class LocalSimulationConnectorModule : ISharedRegionModule, ISimulationService | 44 | public class LocalSimulationConnectorModule : ISharedRegionModule, ISimulationService |
43 | { | 45 | { |
44 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 46 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -58,7 +60,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
58 | /// </summary> | 60 | /// </summary> |
59 | private bool m_ModuleEnabled = false; | 61 | private bool m_ModuleEnabled = false; |
60 | 62 | ||
61 | #region IRegionModule | 63 | #region Region Module interface |
62 | 64 | ||
63 | public void Initialise(IConfigSource config) | 65 | public void Initialise(IConfigSource config) |
64 | { | 66 | { |
@@ -156,7 +158,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
156 | } | 158 | } |
157 | } | 159 | } |
158 | 160 | ||
159 | #endregion /* IRegionModule */ | 161 | #endregion |
160 | 162 | ||
161 | #region ISimulation | 163 | #region ISimulation |
162 | 164 | ||
@@ -313,7 +315,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
313 | 315 | ||
314 | if (m_scenes.ContainsKey(destination.RegionID)) | 316 | if (m_scenes.ContainsKey(destination.RegionID)) |
315 | { | 317 | { |
316 | Util.FireAndForget(delegate { m_scenes[destination.RegionID].IncomingCloseAgent(id); }); | 318 | // m_log.DebugFormat( |
319 | // "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate", | ||
320 | // s.RegionInfo.RegionName, destination.RegionHandle); | ||
321 | |||
322 | Util.FireAndForget(delegate { m_scenes[destination.RegionID].IncomingCloseAgent(id, false); }); | ||
317 | return true; | 323 | return true; |
318 | } | 324 | } |
319 | //m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent"); | 325 | //m_log.Debug("[LOCAL COMMS]: region not found in SendCloseAgent"); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index 68be552..c8698ca 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | |||
@@ -32,6 +32,7 @@ using System.Net; | |||
32 | using System.Reflection; | 32 | using System.Reflection; |
33 | using System.Text; | 33 | using System.Text; |
34 | using log4net; | 34 | using log4net; |
35 | using Mono.Addins; | ||
35 | using Nini.Config; | 36 | using Nini.Config; |
36 | using OpenMetaverse; | 37 | using OpenMetaverse; |
37 | using OpenMetaverse.StructuredData; | 38 | using OpenMetaverse.StructuredData; |
@@ -46,6 +47,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; | |||
46 | 47 | ||
47 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | 48 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation |
48 | { | 49 | { |
50 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemoteSimulationConnectorModule")] | ||
49 | public class RemoteSimulationConnectorModule : ISharedRegionModule, ISimulationService | 51 | public class RemoteSimulationConnectorModule : ISharedRegionModule, ISimulationService |
50 | { | 52 | { |
51 | private bool initialized = false; | 53 | private bool initialized = false; |
@@ -60,7 +62,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
60 | protected bool m_safemode; | 62 | protected bool m_safemode; |
61 | protected IPAddress m_thisIP; | 63 | protected IPAddress m_thisIP; |
62 | 64 | ||
63 | #region IRegionModule | 65 | #region Region Module interface |
64 | 66 | ||
65 | public virtual void Initialise(IConfigSource config) | 67 | public virtual void Initialise(IConfigSource config) |
66 | { | 68 | { |
@@ -147,7 +149,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
147 | m_thisIP = Util.GetHostFromDNS(scene.RegionInfo.ExternalHostName); | 149 | m_thisIP = Util.GetHostFromDNS(scene.RegionInfo.ExternalHostName); |
148 | } | 150 | } |
149 | 151 | ||
150 | #endregion /* IRegionModule */ | 152 | #endregion |
151 | 153 | ||
152 | #region IInterregionComms | 154 | #region IInterregionComms |
153 | 155 | ||
@@ -317,4 +319,4 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
317 | 319 | ||
318 | #endregion /* IInterregionComms */ | 320 | #endregion /* IInterregionComms */ |
319 | } | 321 | } |
320 | } \ No newline at end of file | 322 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs index 1ffd480..ea4ade5 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/LocalUserAccountServiceConnector.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Reflection; | 30 | using System.Reflection; |
31 | using log4net; | 31 | using log4net; |
32 | using Mono.Addins; | ||
32 | using Nini.Config; | 33 | using Nini.Config; |
33 | using OpenSim.Region.Framework.Interfaces; | 34 | using OpenSim.Region.Framework.Interfaces; |
34 | using OpenSim.Region.Framework.Scenes; | 35 | using OpenSim.Region.Framework.Scenes; |
@@ -39,6 +40,7 @@ using OpenMetaverse; | |||
39 | 40 | ||
40 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | 41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts |
41 | { | 42 | { |
43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "LocalUserAccountServicesConnector")] | ||
42 | public class LocalUserAccountServicesConnector : ISharedRegionModule, IUserAccountService | 44 | public class LocalUserAccountServicesConnector : ISharedRegionModule, IUserAccountService |
43 | { | 45 | { |
44 | private static readonly ILog m_log = | 46 | private static readonly ILog m_log = |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs index f6b6aeb..afbba30 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/UserAccounts/RemoteUserAccountServiceConnector.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using Nini.Config; | 29 | using Nini.Config; |
30 | using log4net; | 30 | using log4net; |
31 | using Mono.Addins; | ||
31 | using System.Reflection; | 32 | using System.Reflection; |
32 | using OpenSim.Region.Framework.Interfaces; | 33 | using OpenSim.Region.Framework.Interfaces; |
33 | using OpenSim.Region.Framework.Scenes; | 34 | using OpenSim.Region.Framework.Scenes; |
@@ -39,6 +40,7 @@ using OpenMetaverse; | |||
39 | 40 | ||
40 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts | 41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts |
41 | { | 42 | { |
43 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RemoteUserAccountServicesConnector")] | ||
42 | public class RemoteUserAccountServicesConnector : UserAccountServicesConnector, | 44 | public class RemoteUserAccountServicesConnector : UserAccountServicesConnector, |
43 | ISharedRegionModule, IUserAccountService | 45 | ISharedRegionModule, IUserAccountService |
44 | { | 46 | { |