diff options
Diffstat (limited to 'OpenSim/Services')
6 files changed, 329 insertions, 60 deletions
diff --git a/OpenSim/Services/AssetService/AssetServiceBase.cs b/OpenSim/Services/AssetService/AssetServiceBase.cs index d5faffb..c42d469 100644 --- a/OpenSim/Services/AssetService/AssetServiceBase.cs +++ b/OpenSim/Services/AssetService/AssetServiceBase.cs | |||
@@ -42,18 +42,34 @@ namespace OpenSim.Services.AssetService | |||
42 | 42 | ||
43 | public AssetServiceBase(IConfigSource config) : base(config) | 43 | public AssetServiceBase(IConfigSource config) : base(config) |
44 | { | 44 | { |
45 | IConfig assetConfig = config.Configs["AssetService"]; | 45 | string dllName = String.Empty; |
46 | if (assetConfig == null) | 46 | string connString = String.Empty; |
47 | throw new Exception("No AssetService configuration"); | ||
48 | 47 | ||
49 | string dllName = assetConfig.GetString("StorageProvider", | 48 | // |
50 | String.Empty); | 49 | // Try reading the [DatabaseService] section first, if it exists |
50 | // | ||
51 | IConfig dbConfig = config.Configs["DatabaseService"]; | ||
52 | if (dbConfig != null) | ||
53 | { | ||
54 | dllName = dbConfig.GetString("StorageProvider", String.Empty); | ||
55 | connString = dbConfig.GetString("ConnectionString", String.Empty); | ||
56 | } | ||
51 | 57 | ||
52 | if (dllName == String.Empty) | 58 | // |
53 | throw new Exception("No StorageProvider configured"); | 59 | // Try reading the more specific [AssetService] section, if it exists |
60 | // | ||
61 | IConfig assetConfig = config.Configs["AssetService"]; | ||
62 | if (assetConfig != null) | ||
63 | { | ||
64 | dllName = assetConfig.GetString("StorageProvider", dllName); | ||
65 | connString = assetConfig.GetString("ConnectionString", connString); | ||
66 | } | ||
54 | 67 | ||
55 | string connString = assetConfig.GetString("ConnectionString", | 68 | // |
56 | String.Empty); | 69 | // We tried, but this doesn't exist. We can't proceed. |
70 | // | ||
71 | if (dllName.Equals(String.Empty)) | ||
72 | throw new Exception("No StorageProvider configured"); | ||
57 | 73 | ||
58 | m_Database = LoadPlugin<IAssetDataPlugin>(dllName); | 74 | m_Database = LoadPlugin<IAssetDataPlugin>(dllName); |
59 | if (m_Database == null) | 75 | if (m_Database == null) |
diff --git a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs index 34478ae..093ce92 100644 --- a/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/InventoryServiceConnector.cs | |||
@@ -67,7 +67,7 @@ namespace OpenSim.Services.Connectors | |||
67 | IConfig inventoryConfig = source.Configs["InventoryService"]; | 67 | IConfig inventoryConfig = source.Configs["InventoryService"]; |
68 | if (inventoryConfig == null) | 68 | if (inventoryConfig == null) |
69 | { | 69 | { |
70 | m_log.Error("[INVENTORY CONNECTOR]: InventoryService missing from OpanSim.ini"); | 70 | m_log.Error("[INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini"); |
71 | throw new Exception("Inventory connector init error"); | 71 | throw new Exception("Inventory connector init error"); |
72 | } | 72 | } |
73 | 73 | ||
@@ -77,7 +77,7 @@ namespace OpenSim.Services.Connectors | |||
77 | if (serviceURI == String.Empty) | 77 | if (serviceURI == String.Empty) |
78 | { | 78 | { |
79 | m_log.Error("[INVENTORY CONNECTOR]: No Server URI named in section InventoryService"); | 79 | m_log.Error("[INVENTORY CONNECTOR]: No Server URI named in section InventoryService"); |
80 | throw new Exception("Inventory connector init error"); | 80 | throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's"); |
81 | } | 81 | } |
82 | m_ServerURI = serviceURI.TrimEnd('/'); | 82 | m_ServerURI = serviceURI.TrimEnd('/'); |
83 | } | 83 | } |
diff --git a/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs b/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs new file mode 100644 index 0000000..3264f41 --- /dev/null +++ b/OpenSim/Services/Connectors/Inventory/QuickAndDirtyInventoryServiceConnector.cs | |||
@@ -0,0 +1,170 @@ | |||
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 log4net; | ||
29 | using System; | ||
30 | using System.Collections.Generic; | ||
31 | using System.IO; | ||
32 | using System.Reflection; | ||
33 | using Nini.Config; | ||
34 | using OpenSim.Framework; | ||
35 | using OpenSim.Framework.Servers.HttpServer; | ||
36 | using OpenSim.Services.Interfaces; | ||
37 | using OpenMetaverse; | ||
38 | |||
39 | namespace OpenSim.Services.Connectors | ||
40 | { | ||
41 | /// <summary> | ||
42 | /// This connector is temporary. It's used by the user server, before that server is refactored. | ||
43 | /// </summary> | ||
44 | public class QuickAndDirtyInventoryServiceConnector : IInventoryService | ||
45 | { | ||
46 | private static readonly ILog m_log = | ||
47 | LogManager.GetLogger( | ||
48 | MethodBase.GetCurrentMethod().DeclaringType); | ||
49 | |||
50 | private string m_ServerURI = String.Empty; | ||
51 | |||
52 | private Dictionary<UUID, InventoryReceiptCallback> m_RequestingInventory = new Dictionary<UUID, InventoryReceiptCallback>(); | ||
53 | |||
54 | public QuickAndDirtyInventoryServiceConnector() | ||
55 | { | ||
56 | } | ||
57 | |||
58 | public QuickAndDirtyInventoryServiceConnector(string serverURI) | ||
59 | { | ||
60 | m_ServerURI = serverURI.TrimEnd('/'); | ||
61 | } | ||
62 | |||
63 | /// <summary> | ||
64 | /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/> | ||
65 | /// </summary> | ||
66 | /// <param name="userId"></param> | ||
67 | /// <returns></returns> | ||
68 | public bool CreateUserInventory(UUID userId) | ||
69 | { | ||
70 | return SynchronousRestObjectPoster.BeginPostObject<Guid, bool>( | ||
71 | "POST", m_ServerURI + "CreateInventory/", userId.Guid); | ||
72 | } | ||
73 | |||
74 | /// <summary> | ||
75 | /// <see cref="OpenSim.Framework.Communications.IInterServiceInventoryServices"/> | ||
76 | /// </summary> | ||
77 | /// <param name="userId"></param> | ||
78 | /// <returns></returns> | ||
79 | public List<InventoryFolderBase> GetInventorySkeleton(UUID userId) | ||
80 | { | ||
81 | return SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryFolderBase>>( | ||
82 | "POST", m_ServerURI + "RootFolders/", userId.Guid); | ||
83 | } | ||
84 | |||
85 | /// <summary> | ||
86 | /// Returns a list of all the active gestures in a user's inventory. | ||
87 | /// </summary> | ||
88 | /// <param name="userId"> | ||
89 | /// The <see cref="UUID"/> of the user | ||
90 | /// </param> | ||
91 | /// <returns> | ||
92 | /// A flat list of the gesture items. | ||
93 | /// </returns> | ||
94 | public List<InventoryItemBase> GetActiveGestures(UUID userId) | ||
95 | { | ||
96 | return SynchronousRestObjectPoster.BeginPostObject<Guid, List<InventoryItemBase>>( | ||
97 | "POST", m_ServerURI + "ActiveGestures/", userId.Guid); | ||
98 | } | ||
99 | |||
100 | public InventoryCollection GetUserInventory(UUID userID) | ||
101 | { | ||
102 | return null; | ||
103 | } | ||
104 | |||
105 | public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) | ||
106 | { | ||
107 | } | ||
108 | |||
109 | public List<InventoryItemBase> GetFolderItems(UUID folderID) | ||
110 | { | ||
111 | return null; | ||
112 | } | ||
113 | |||
114 | public bool AddFolder(InventoryFolderBase folder) | ||
115 | { | ||
116 | return false; | ||
117 | } | ||
118 | |||
119 | public bool UpdateFolder(InventoryFolderBase folder) | ||
120 | { | ||
121 | return false; | ||
122 | } | ||
123 | |||
124 | public bool MoveFolder(InventoryFolderBase folder) | ||
125 | { | ||
126 | return false; | ||
127 | } | ||
128 | |||
129 | public bool PurgeFolder(InventoryFolderBase folder) | ||
130 | { | ||
131 | return false; | ||
132 | } | ||
133 | |||
134 | public bool AddItem(InventoryItemBase item) | ||
135 | { | ||
136 | return false; | ||
137 | } | ||
138 | |||
139 | public bool UpdateItem(InventoryItemBase item) | ||
140 | { | ||
141 | return false; | ||
142 | } | ||
143 | |||
144 | public bool DeleteItem(InventoryItemBase item) | ||
145 | { | ||
146 | return false; | ||
147 | } | ||
148 | |||
149 | public InventoryItemBase QueryItem(InventoryItemBase item) | ||
150 | { | ||
151 | return null; | ||
152 | } | ||
153 | |||
154 | public InventoryFolderBase QueryFolder(InventoryFolderBase folder) | ||
155 | { | ||
156 | return null; | ||
157 | } | ||
158 | |||
159 | public bool HasInventoryForUser(UUID userID) | ||
160 | { | ||
161 | return false; | ||
162 | } | ||
163 | |||
164 | public InventoryFolderBase RequestRootFolder(UUID userID) | ||
165 | { | ||
166 | return null; | ||
167 | } | ||
168 | |||
169 | } | ||
170 | } | ||
diff --git a/OpenSim/Services/InventoryService/HGInventoryService.cs b/OpenSim/Services/InventoryService/HGInventoryService.cs index e5e40c6..0db80d0 100644 --- a/OpenSim/Services/InventoryService/HGInventoryService.cs +++ b/OpenSim/Services/InventoryService/HGInventoryService.cs | |||
@@ -109,6 +109,7 @@ namespace OpenSim.Services.InventoryService | |||
109 | 109 | ||
110 | public void GetUserInventory(string id, UUID sessionID, InventoryReceiptCallback callback) | 110 | public void GetUserInventory(string id, UUID sessionID, InventoryReceiptCallback callback) |
111 | { | 111 | { |
112 | m_log.Debug("[HGInventory]: GetUserInventory " + id); | ||
112 | string url = string.Empty; | 113 | string url = string.Empty; |
113 | string userID = string.Empty; | 114 | string userID = string.Empty; |
114 | 115 | ||
@@ -120,57 +121,120 @@ namespace OpenSim.Services.InventoryService | |||
120 | 121 | ||
121 | } | 122 | } |
122 | 123 | ||
123 | public bool AddFolder(string userID, InventoryFolderBase folder, UUID sessionID) | 124 | public bool AddFolder(string id, InventoryFolderBase folder, UUID sessionID) |
124 | { | 125 | { |
125 | // TODO | 126 | string url = string.Empty; |
127 | string userID = string.Empty; | ||
128 | |||
129 | if (StringToUrlAndUserID(id, out url, out userID)) | ||
130 | { | ||
131 | ISessionAuthInventoryService connector = GetConnector(url); | ||
132 | return connector.AddFolder(userID, folder, sessionID); | ||
133 | } | ||
126 | return false; | 134 | return false; |
127 | } | 135 | } |
128 | 136 | ||
129 | public bool UpdateFolder(string userID, InventoryFolderBase folder, UUID sessionID) | 137 | public bool UpdateFolder(string id, InventoryFolderBase folder, UUID sessionID) |
130 | { | 138 | { |
131 | // TODO | 139 | string url = string.Empty; |
140 | string userID = string.Empty; | ||
141 | |||
142 | if (StringToUrlAndUserID(id, out url, out userID)) | ||
143 | { | ||
144 | ISessionAuthInventoryService connector = GetConnector(url); | ||
145 | return connector.UpdateFolder(userID, folder, sessionID); | ||
146 | } | ||
132 | return false; | 147 | return false; |
133 | } | 148 | } |
134 | 149 | ||
135 | public bool MoveFolder(string userID, InventoryFolderBase folder, UUID sessionID) | 150 | public bool MoveFolder(string id, InventoryFolderBase folder, UUID sessionID) |
136 | { | 151 | { |
137 | // TODO | 152 | string url = string.Empty; |
153 | string userID = string.Empty; | ||
154 | |||
155 | if (StringToUrlAndUserID(id, out url, out userID)) | ||
156 | { | ||
157 | ISessionAuthInventoryService connector = GetConnector(url); | ||
158 | return connector.MoveFolder(userID, folder, sessionID); | ||
159 | } | ||
138 | return false; | 160 | return false; |
139 | } | 161 | } |
140 | 162 | ||
141 | public bool PurgeFolder(string userID, InventoryFolderBase folder, UUID sessionID) | 163 | public bool PurgeFolder(string id, InventoryFolderBase folder, UUID sessionID) |
142 | { | 164 | { |
143 | // TODO | 165 | string url = string.Empty; |
166 | string userID = string.Empty; | ||
167 | |||
168 | if (StringToUrlAndUserID(id, out url, out userID)) | ||
169 | { | ||
170 | ISessionAuthInventoryService connector = GetConnector(url); | ||
171 | return connector.PurgeFolder(userID, folder, sessionID); | ||
172 | } | ||
144 | return false; | 173 | return false; |
145 | } | 174 | } |
146 | 175 | ||
147 | public bool AddItem(string userID, InventoryItemBase item, UUID sessionID) | 176 | public bool AddItem(string id, InventoryItemBase item, UUID sessionID) |
148 | { | 177 | { |
149 | // TODO | 178 | string url = string.Empty; |
179 | string userID = string.Empty; | ||
180 | |||
181 | if (StringToUrlAndUserID(id, out url, out userID)) | ||
182 | { | ||
183 | ISessionAuthInventoryService connector = GetConnector(url); | ||
184 | return connector.AddItem(userID, item, sessionID); | ||
185 | } | ||
150 | return false; | 186 | return false; |
151 | } | 187 | } |
152 | 188 | ||
153 | public bool UpdateItem(string userID, InventoryItemBase item, UUID sessionID) | 189 | public bool UpdateItem(string id, InventoryItemBase item, UUID sessionID) |
154 | { | 190 | { |
155 | // TODO | 191 | string url = string.Empty; |
192 | string userID = string.Empty; | ||
193 | |||
194 | if (StringToUrlAndUserID(id, out url, out userID)) | ||
195 | { | ||
196 | ISessionAuthInventoryService connector = GetConnector(url); | ||
197 | return connector.UpdateItem(userID, item, sessionID); | ||
198 | } | ||
156 | return false; | 199 | return false; |
157 | } | 200 | } |
158 | 201 | ||
159 | public bool DeleteItem(string userID, InventoryItemBase item, UUID sessionID) | 202 | public bool DeleteItem(string id, InventoryItemBase item, UUID sessionID) |
160 | { | 203 | { |
161 | // TODO | 204 | string url = string.Empty; |
205 | string userID = string.Empty; | ||
206 | |||
207 | if (StringToUrlAndUserID(id, out url, out userID)) | ||
208 | { | ||
209 | ISessionAuthInventoryService connector = GetConnector(url); | ||
210 | return connector.UpdateItem(userID, item, sessionID); | ||
211 | } | ||
162 | return false; | 212 | return false; |
163 | } | 213 | } |
164 | 214 | ||
165 | public InventoryItemBase QueryItem(string userID, InventoryItemBase item, UUID sessionID) | 215 | public InventoryItemBase QueryItem(string id, InventoryItemBase item, UUID sessionID) |
166 | { | 216 | { |
167 | // TODO | 217 | string url = string.Empty; |
218 | string userID = string.Empty; | ||
219 | |||
220 | if (StringToUrlAndUserID(id, out url, out userID)) | ||
221 | { | ||
222 | ISessionAuthInventoryService connector = GetConnector(url); | ||
223 | return connector.QueryItem(userID, item, sessionID); | ||
224 | } | ||
168 | return null; | 225 | return null; |
169 | } | 226 | } |
170 | 227 | ||
171 | public InventoryFolderBase QueryFolder(string userID, InventoryFolderBase folder, UUID sessionID) | 228 | public InventoryFolderBase QueryFolder(string id, InventoryFolderBase folder, UUID sessionID) |
172 | { | 229 | { |
173 | // TODO | 230 | string url = string.Empty; |
231 | string userID = string.Empty; | ||
232 | |||
233 | if (StringToUrlAndUserID(id, out url, out userID)) | ||
234 | { | ||
235 | ISessionAuthInventoryService connector = GetConnector(url); | ||
236 | return connector.QueryFolder(userID, folder, sessionID); | ||
237 | } | ||
174 | return null; | 238 | return null; |
175 | } | 239 | } |
176 | 240 | ||
diff --git a/OpenSim/Services/InventoryService/InventoryService.cs b/OpenSim/Services/InventoryService/InventoryService.cs index f2a7b41..9dbd591 100644 --- a/OpenSim/Services/InventoryService/InventoryService.cs +++ b/OpenSim/Services/InventoryService/InventoryService.cs | |||
@@ -46,6 +46,7 @@ namespace OpenSim.Services.InventoryService | |||
46 | 46 | ||
47 | public InventoryService(IConfigSource config) : base(config) | 47 | public InventoryService(IConfigSource config) : base(config) |
48 | { | 48 | { |
49 | m_log.Debug("[INVENTORY SERVICE]: Initialized."); | ||
49 | } | 50 | } |
50 | 51 | ||
51 | #region IInventoryServices methods | 52 | #region IInventoryServices methods |
@@ -57,7 +58,7 @@ namespace OpenSim.Services.InventoryService | |||
57 | 58 | ||
58 | public List<InventoryFolderBase> GetInventorySkeleton(UUID userId) | 59 | public List<InventoryFolderBase> GetInventorySkeleton(UUID userId) |
59 | { | 60 | { |
60 | // m_log.DebugFormat("[AGENT INVENTORY]: Getting inventory skeleton for {0}", userId); | 61 | m_log.DebugFormat("[INVENTORY SERVICE]: Getting inventory skeleton for {0}", userId); |
61 | 62 | ||
62 | InventoryFolderBase rootFolder = RequestRootFolder(userId); | 63 | InventoryFolderBase rootFolder = RequestRootFolder(userId); |
63 | 64 | ||
@@ -79,7 +80,7 @@ namespace OpenSim.Services.InventoryService | |||
79 | 80 | ||
80 | // foreach (InventoryFolderBase folder in userFolders) | 81 | // foreach (InventoryFolderBase folder in userFolders) |
81 | // { | 82 | // { |
82 | // m_log.DebugFormat("[AGENT INVENTORY]: Got folder {0} {1}", folder.name, folder.folderID); | 83 | // m_log.DebugFormat("[INVENTORY SERVICE]: Got folder {0} {1}", folder.name, folder.folderID); |
83 | // } | 84 | // } |
84 | 85 | ||
85 | return userFolders; | 86 | return userFolders; |
@@ -113,7 +114,7 @@ namespace OpenSim.Services.InventoryService | |||
113 | if (null != existingRootFolder) | 114 | if (null != existingRootFolder) |
114 | { | 115 | { |
115 | m_log.WarnFormat( | 116 | m_log.WarnFormat( |
116 | "[AGENT INVENTORY]: Did not create a new inventory for user {0} since they already have " | 117 | "[INVENTORY SERVICE]: Did not create a new inventory for user {0} since they already have " |
117 | + "a root inventory folder with id {1}", | 118 | + "a root inventory folder with id {1}", |
118 | user, existingRootFolder.ID); | 119 | user, existingRootFolder.ID); |
119 | } | 120 | } |
@@ -138,7 +139,7 @@ namespace OpenSim.Services.InventoryService | |||
138 | /// <returns>The user's inventory. If an inventory cannot be found then an empty collection is returned.</returns> | 139 | /// <returns>The user's inventory. If an inventory cannot be found then an empty collection is returned.</returns> |
139 | public InventoryCollection GetUserInventory(UUID userID) | 140 | public InventoryCollection GetUserInventory(UUID userID) |
140 | { | 141 | { |
141 | m_log.InfoFormat("[LOCAL INVENTORY SERVICE]: Processing request for inventory of {0}", userID); | 142 | m_log.InfoFormat("[INVENTORY SERVICE]: Processing request for inventory of {0}", userID); |
142 | 143 | ||
143 | // Uncomment me to simulate a slow responding inventory server | 144 | // Uncomment me to simulate a slow responding inventory server |
144 | //Thread.Sleep(16000); | 145 | //Thread.Sleep(16000); |
@@ -149,7 +150,7 @@ namespace OpenSim.Services.InventoryService | |||
149 | 150 | ||
150 | if (null == allFolders) | 151 | if (null == allFolders) |
151 | { | 152 | { |
152 | m_log.WarnFormat("[LOCAL INVENTORY SERVICE]: No inventory found for user {0}", userID); | 153 | m_log.WarnFormat("[INVENTORY SERVICE]: No inventory found for user {0}", userID); |
153 | 154 | ||
154 | return invCollection; | 155 | return invCollection; |
155 | } | 156 | } |
@@ -172,16 +173,16 @@ namespace OpenSim.Services.InventoryService | |||
172 | 173 | ||
173 | // foreach (InventoryFolderBase folder in invCollection.Folders) | 174 | // foreach (InventoryFolderBase folder in invCollection.Folders) |
174 | // { | 175 | // { |
175 | // m_log.DebugFormat("[GRID AGENT INVENTORY]: Sending back folder {0} {1}", folder.Name, folder.ID); | 176 | // m_log.DebugFormat("[GRID INVENTORY SERVICE]: Sending back folder {0} {1}", folder.Name, folder.ID); |
176 | // } | 177 | // } |
177 | // | 178 | // |
178 | // foreach (InventoryItemBase item in invCollection.Items) | 179 | // foreach (InventoryItemBase item in invCollection.Items) |
179 | // { | 180 | // { |
180 | // m_log.DebugFormat("[GRID AGENT INVENTORY]: Sending back item {0} {1}, folder {2}", item.Name, item.ID, item.Folder); | 181 | // m_log.DebugFormat("[GRID INVENTORY SERVICE]: Sending back item {0} {1}, folder {2}", item.Name, item.ID, item.Folder); |
181 | // } | 182 | // } |
182 | 183 | ||
183 | m_log.InfoFormat( | 184 | m_log.InfoFormat( |
184 | "[LOCAL INVENTORY SERVICE]: Sending back inventory response to user {0} containing {1} folders and {2} items", | 185 | "[INVENTORY SERVICE]: Sending back inventory response to user {0} containing {1} folders and {2} items", |
185 | invCollection.UserID, invCollection.Folders.Count, invCollection.Items.Count); | 186 | invCollection.UserID, invCollection.Folders.Count, invCollection.Items.Count); |
186 | 187 | ||
187 | return invCollection; | 188 | return invCollection; |
@@ -194,7 +195,7 @@ namespace OpenSim.Services.InventoryService | |||
194 | /// <param name="callback"></param> | 195 | /// <param name="callback"></param> |
195 | public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) | 196 | public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) |
196 | { | 197 | { |
197 | m_log.InfoFormat("[LOCAL INVENTORY SERVICE]: Requesting inventory for user {0}", userID); | 198 | m_log.InfoFormat("[INVENTORY SERVICE]: Requesting inventory for user {0}", userID); |
198 | 199 | ||
199 | List<InventoryFolderImpl> folders = new List<InventoryFolderImpl>(); | 200 | List<InventoryFolderImpl> folders = new List<InventoryFolderImpl>(); |
200 | List<InventoryItemBase> items = new List<InventoryItemBase>(); | 201 | List<InventoryItemBase> items = new List<InventoryItemBase>(); |
@@ -231,15 +232,15 @@ namespace OpenSim.Services.InventoryService | |||
231 | } | 232 | } |
232 | 233 | ||
233 | m_log.InfoFormat( | 234 | m_log.InfoFormat( |
234 | "[LOCAL INVENTORY SERVICE]: Received inventory response for user {0} containing {1} folders and {2} items", | 235 | "[INVENTORY SERVICE]: Received inventory response for user {0} containing {1} folders and {2} items", |
235 | userID, folders.Count, items.Count); | 236 | userID, folders.Count, items.Count); |
236 | } | 237 | } |
237 | else | 238 | else |
238 | { | 239 | { |
239 | m_log.WarnFormat("[LOCAL INVENTORY SERVICE]: User {0} inventory not available", userID); | 240 | m_log.WarnFormat("[INVENTORY SERVICE]: User {0} inventory not available", userID); |
240 | } | 241 | } |
241 | 242 | ||
242 | callback(folders, items); | 243 | callback.BeginInvoke(folders, items, null, null); |
243 | } | 244 | } |
244 | 245 | ||
245 | public List<InventoryItemBase> GetActiveGestures(UUID userId) | 246 | public List<InventoryItemBase> GetActiveGestures(UUID userId) |
@@ -287,7 +288,7 @@ namespace OpenSim.Services.InventoryService | |||
287 | public virtual bool AddFolder(InventoryFolderBase folder) | 288 | public virtual bool AddFolder(InventoryFolderBase folder) |
288 | { | 289 | { |
289 | m_log.DebugFormat( | 290 | m_log.DebugFormat( |
290 | "[AGENT INVENTORY]: Adding folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); | 291 | "[INVENTORY SERVICE]: Adding folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); |
291 | 292 | ||
292 | foreach (IInventoryDataPlugin plugin in m_plugins) | 293 | foreach (IInventoryDataPlugin plugin in m_plugins) |
293 | { | 294 | { |
@@ -302,7 +303,7 @@ namespace OpenSim.Services.InventoryService | |||
302 | public virtual bool UpdateFolder(InventoryFolderBase folder) | 303 | public virtual bool UpdateFolder(InventoryFolderBase folder) |
303 | { | 304 | { |
304 | m_log.DebugFormat( | 305 | m_log.DebugFormat( |
305 | "[AGENT INVENTORY]: Updating folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); | 306 | "[INVENTORY SERVICE]: Updating folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); |
306 | 307 | ||
307 | foreach (IInventoryDataPlugin plugin in m_plugins) | 308 | foreach (IInventoryDataPlugin plugin in m_plugins) |
308 | { | 309 | { |
@@ -317,7 +318,7 @@ namespace OpenSim.Services.InventoryService | |||
317 | public virtual bool MoveFolder(InventoryFolderBase folder) | 318 | public virtual bool MoveFolder(InventoryFolderBase folder) |
318 | { | 319 | { |
319 | m_log.DebugFormat( | 320 | m_log.DebugFormat( |
320 | "[AGENT INVENTORY]: Moving folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); | 321 | "[INVENTORY SERVICE]: Moving folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); |
321 | 322 | ||
322 | foreach (IInventoryDataPlugin plugin in m_plugins) | 323 | foreach (IInventoryDataPlugin plugin in m_plugins) |
323 | { | 324 | { |
@@ -332,7 +333,7 @@ namespace OpenSim.Services.InventoryService | |||
332 | public virtual bool AddItem(InventoryItemBase item) | 333 | public virtual bool AddItem(InventoryItemBase item) |
333 | { | 334 | { |
334 | m_log.DebugFormat( | 335 | m_log.DebugFormat( |
335 | "[AGENT INVENTORY]: Adding item {0} {1} to folder {2}", item.Name, item.ID, item.Folder); | 336 | "[INVENTORY SERVICE]: Adding item {0} {1} to folder {2}", item.Name, item.ID, item.Folder); |
336 | 337 | ||
337 | foreach (IInventoryDataPlugin plugin in m_plugins) | 338 | foreach (IInventoryDataPlugin plugin in m_plugins) |
338 | { | 339 | { |
@@ -347,7 +348,7 @@ namespace OpenSim.Services.InventoryService | |||
347 | public virtual bool UpdateItem(InventoryItemBase item) | 348 | public virtual bool UpdateItem(InventoryItemBase item) |
348 | { | 349 | { |
349 | m_log.InfoFormat( | 350 | m_log.InfoFormat( |
350 | "[AGENT INVENTORY]: Updating item {0} {1} in folder {2}", item.Name, item.ID, item.Folder); | 351 | "[INVENTORY SERVICE]: Updating item {0} {1} in folder {2}", item.Name, item.ID, item.Folder); |
351 | 352 | ||
352 | foreach (IInventoryDataPlugin plugin in m_plugins) | 353 | foreach (IInventoryDataPlugin plugin in m_plugins) |
353 | { | 354 | { |
@@ -362,7 +363,7 @@ namespace OpenSim.Services.InventoryService | |||
362 | public virtual bool DeleteItem(InventoryItemBase item) | 363 | public virtual bool DeleteItem(InventoryItemBase item) |
363 | { | 364 | { |
364 | m_log.InfoFormat( | 365 | m_log.InfoFormat( |
365 | "[AGENT INVENTORY]: Deleting item {0} {1} from folder {2}", item.Name, item.ID, item.Folder); | 366 | "[INVENTORY SERVICE]: Deleting item {0} {1} from folder {2}", item.Name, item.ID, item.Folder); |
366 | 367 | ||
367 | foreach (IInventoryDataPlugin plugin in m_plugins) | 368 | foreach (IInventoryDataPlugin plugin in m_plugins) |
368 | { | 369 | { |
@@ -407,13 +408,13 @@ namespace OpenSim.Services.InventoryService | |||
407 | public virtual bool PurgeFolder(InventoryFolderBase folder) | 408 | public virtual bool PurgeFolder(InventoryFolderBase folder) |
408 | { | 409 | { |
409 | m_log.DebugFormat( | 410 | m_log.DebugFormat( |
410 | "[AGENT INVENTORY]: Purging folder {0} {1} of its contents", folder.Name, folder.ID); | 411 | "[INVENTORY SERVICE]: Purging folder {0} {1} of its contents", folder.Name, folder.ID); |
411 | 412 | ||
412 | List<InventoryFolderBase> subFolders = RequestSubFolders(folder.ID); | 413 | List<InventoryFolderBase> subFolders = RequestSubFolders(folder.ID); |
413 | 414 | ||
414 | foreach (InventoryFolderBase subFolder in subFolders) | 415 | foreach (InventoryFolderBase subFolder in subFolders) |
415 | { | 416 | { |
416 | // m_log.DebugFormat("[AGENT INVENTORY]: Deleting folder {0} {1}", subFolder.Name, subFolder.ID); | 417 | // m_log.DebugFormat("[INVENTORY SERVICE]: Deleting folder {0} {1}", subFolder.Name, subFolder.ID); |
417 | 418 | ||
418 | foreach (IInventoryDataPlugin plugin in m_plugins) | 419 | foreach (IInventoryDataPlugin plugin in m_plugins) |
419 | { | 420 | { |
diff --git a/OpenSim/Services/InventoryService/InventoryServiceBase.cs b/OpenSim/Services/InventoryService/InventoryServiceBase.cs index 179d541..4526c34 100644 --- a/OpenSim/Services/InventoryService/InventoryServiceBase.cs +++ b/OpenSim/Services/InventoryService/InventoryServiceBase.cs | |||
@@ -44,19 +44,37 @@ namespace OpenSim.Services.InventoryService | |||
44 | 44 | ||
45 | public InventoryServiceBase(IConfigSource config) : base(config) | 45 | public InventoryServiceBase(IConfigSource config) : base(config) |
46 | { | 46 | { |
47 | IConfig assetConfig = config.Configs["InventoryService"]; | 47 | string dllName = String.Empty; |
48 | if (assetConfig == null) | 48 | string connString = String.Empty; |
49 | |||
50 | // | ||
51 | // Try reading the [DatabaseService] section first, if it exists | ||
52 | // | ||
53 | IConfig dbConfig = config.Configs["DatabaseService"]; | ||
54 | if (dbConfig != null) | ||
55 | { | ||
56 | dllName = dbConfig.GetString("StorageProvider", String.Empty); | ||
57 | connString = dbConfig.GetString("ConnectionString", String.Empty); | ||
58 | } | ||
59 | else | ||
60 | Console.WriteLine("------ dbConfig = null!"); | ||
61 | |||
62 | // | ||
63 | // Try reading the more specific [InventoryService] section, if it exists | ||
64 | // | ||
65 | IConfig inventoryConfig = config.Configs["InventoryService"]; | ||
66 | if (inventoryConfig != null) | ||
67 | { | ||
68 | dllName = inventoryConfig.GetString("StorageProvider", dllName); | ||
69 | connString = inventoryConfig.GetString("ConnectionString", connString); | ||
70 | } | ||
71 | |||
72 | // | ||
73 | // We tried, but this doesn't exist. We can't proceed. | ||
74 | // | ||
75 | if (dllName.Equals(String.Empty)) | ||
49 | throw new Exception("No InventoryService configuration"); | 76 | throw new Exception("No InventoryService configuration"); |
50 | 77 | ||
51 | string dllName = assetConfig.GetString("StorageProvider", | ||
52 | String.Empty); | ||
53 | |||
54 | if (dllName == String.Empty) | ||
55 | throw new Exception("No StorageProvider configured"); | ||
56 | |||
57 | string connString = assetConfig.GetString("ConnectionString", | ||
58 | String.Empty); | ||
59 | |||
60 | m_Database = LoadPlugin<IInventoryDataPlugin>(dllName); | 78 | m_Database = LoadPlugin<IInventoryDataPlugin>(dllName); |
61 | if (m_Database == null) | 79 | if (m_Database == null) |
62 | throw new Exception("Could not find a storage interface in the given module"); | 80 | throw new Exception("Could not find a storage interface in the given module"); |