diff options
author | Melanie Thielker | 2009-05-09 03:08:11 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-05-09 03:08:11 +0000 |
commit | b2b13c5a428e9cc3da0399d0b69ee4e9051f28ac (patch) | |
tree | a43e101b0a12cb77eb18df8976455a5c72e7c06a /OpenSim/Region/CoreModules | |
parent | Add the asset service connectors and sample config. READ WARNINGS!!! (diff) | |
download | opensim-SC_OLD-b2b13c5a428e9cc3da0399d0b69ee4e9051f28ac.zip opensim-SC_OLD-b2b13c5a428e9cc3da0399d0b69ee4e9051f28ac.tar.gz opensim-SC_OLD-b2b13c5a428e9cc3da0399d0b69ee4e9051f28ac.tar.bz2 opensim-SC_OLD-b2b13c5a428e9cc3da0399d0b69ee4e9051f28ac.tar.xz |
Plumb the remote asset hookup, all but the actual requests
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectors/Asset/LocalAssetServiceConnector.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectors/Asset/RemoteAssetServiceConnector.cs | 68 |
2 files changed, 59 insertions, 13 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectors/Asset/LocalAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectors/Asset/LocalAssetServiceConnector.cs index 20e6de5..24ac8be 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectors/Asset/LocalAssetServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectors/Asset/LocalAssetServiceConnector.cs | |||
@@ -109,14 +109,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectors.Asset | |||
109 | 109 | ||
110 | public void RemoveRegion(Scene scene) | 110 | public void RemoveRegion(Scene scene) |
111 | { | 111 | { |
112 | if (!m_Enabled) | ||
113 | return; | ||
114 | } | 112 | } |
115 | 113 | ||
116 | public void RegionLoaded(Scene scene) | 114 | public void RegionLoaded(Scene scene) |
117 | { | 115 | { |
118 | if (!m_Enabled) | ||
119 | return; | ||
120 | } | 116 | } |
121 | } | 117 | } |
122 | } | 118 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectors/Asset/RemoteAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectors/Asset/RemoteAssetServiceConnector.cs index 15e4b5a..715cf6e 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectors/Asset/RemoteAssetServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectors/Asset/RemoteAssetServiceConnector.cs | |||
@@ -25,16 +25,26 @@ | |||
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 | ||
28 | using log4net; | ||
29 | using System; | ||
30 | using System.Reflection; | ||
28 | using Nini.Config; | 31 | using Nini.Config; |
32 | using OpenSim.Framework; | ||
29 | using OpenSim.Region.Framework.Interfaces; | 33 | using OpenSim.Region.Framework.Interfaces; |
30 | using OpenSim.Region.Framework.Scenes; | 34 | using OpenSim.Region.Framework.Scenes; |
31 | using OpenSim.Services.Interfaces; | 35 | using OpenSim.Services.Interfaces; |
32 | 36 | ||
33 | namespace OpenSim.Region.CoreModules.ServiceConnectors.Asset | 37 | namespace OpenSim.Region.CoreModules.ServiceConnectors.Asset |
34 | { | 38 | { |
35 | public class RemoteAssetServicesConnector : ISharedRegionModule | 39 | public class RemoteAssetServicesConnector : |
40 | ISharedRegionModule, IAssetService | ||
36 | { | 41 | { |
42 | private static readonly ILog m_log = | ||
43 | LogManager.GetLogger( | ||
44 | MethodBase.GetCurrentMethod().DeclaringType); | ||
45 | |||
37 | private bool m_Enabled = false; | 46 | private bool m_Enabled = false; |
47 | private string m_ServerURI = String.Empty; | ||
38 | 48 | ||
39 | public string Name | 49 | public string Name |
40 | { | 50 | { |
@@ -49,39 +59,79 @@ namespace OpenSim.Region.CoreModules.ServiceConnectors.Asset | |||
49 | string name = moduleConfig.GetString("AssetServices", ""); | 59 | string name = moduleConfig.GetString("AssetServices", ""); |
50 | if (name == Name) | 60 | if (name == Name) |
51 | { | 61 | { |
62 | IConfig assetConfig = source.Configs["AssetService"]; | ||
63 | if (assetConfig == null) | ||
64 | { | ||
65 | m_log.Error("[ASSET CONNECTOR]: AssetService missing from OpanSim.ini"); | ||
66 | return; | ||
67 | } | ||
68 | |||
69 | string serviceURI = assetConfig.GetString("AssetServerURI", | ||
70 | String.Empty); | ||
71 | |||
72 | if (serviceURI == String.Empty) | ||
73 | { | ||
74 | m_log.Error("[ASSET CONNECTOR]: No Server URI named in section AssetService"); | ||
75 | return; | ||
76 | } | ||
52 | m_Enabled = true; | 77 | m_Enabled = true; |
78 | m_ServerURI = serviceURI; | ||
53 | } | 79 | } |
54 | } | 80 | } |
55 | } | 81 | } |
56 | 82 | ||
57 | public void PostInitialise() | 83 | public void PostInitialise() |
58 | { | 84 | { |
59 | if (!m_Enabled) | ||
60 | return; | ||
61 | } | 85 | } |
62 | 86 | ||
63 | public void Close() | 87 | public void Close() |
64 | { | 88 | { |
65 | if (!m_Enabled) | ||
66 | return; | ||
67 | } | 89 | } |
68 | 90 | ||
69 | public void AddRegion(Scene scene) | 91 | public void AddRegion(Scene scene) |
70 | { | 92 | { |
71 | if (!m_Enabled) | 93 | if (!m_Enabled) |
72 | return; | 94 | return; |
95 | |||
96 | scene.RegisterModuleInterface<IAssetService>(this); | ||
73 | } | 97 | } |
74 | 98 | ||
75 | public void RemoveRegion(Scene scene) | 99 | public void RemoveRegion(Scene scene) |
76 | { | 100 | { |
77 | if (!m_Enabled) | ||
78 | return; | ||
79 | } | 101 | } |
80 | 102 | ||
81 | public void RegionLoaded(Scene scene) | 103 | public void RegionLoaded(Scene scene) |
82 | { | 104 | { |
83 | if (!m_Enabled) | 105 | } |
84 | return; | 106 | |
107 | public AssetBase Get(string id) | ||
108 | { | ||
109 | return null; | ||
110 | } | ||
111 | |||
112 | public AssetMetadata GetMetadata(string id) | ||
113 | { | ||
114 | return null; | ||
115 | } | ||
116 | |||
117 | public byte[] GetData(string id) | ||
118 | { | ||
119 | return new byte[0]; | ||
120 | } | ||
121 | |||
122 | public string Store(AssetBase asset) | ||
123 | { | ||
124 | return String.Empty; | ||
125 | } | ||
126 | |||
127 | public bool UpdateContent(string id, byte[] data) | ||
128 | { | ||
129 | return false; | ||
130 | } | ||
131 | |||
132 | public bool Delete(string id) | ||
133 | { | ||
134 | return false; | ||
85 | } | 135 | } |
86 | } | 136 | } |
87 | } | 137 | } |