diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLSimulationData.cs | 2 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteSimulationData.cs | 5 | ||||
-rw-r--r-- | OpenSim/Framework/Servers/MainServer.cs | 8 | ||||
-rw-r--r-- | OpenSim/Framework/WebUtil.cs | 54 | ||||
-rw-r--r-- | OpenSim/Region/DataSnapshot/DataRequestHandler.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/DataSnapshot/SnapshotStore.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 5 | ||||
-rw-r--r-- | OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs | 2 | ||||
-rw-r--r-- | OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs | 124 | ||||
-rw-r--r-- | OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs | 24 |
10 files changed, 153 insertions, 87 deletions
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 448962a..de52623 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs | |||
@@ -457,8 +457,6 @@ namespace OpenSim.Data.MySQL | |||
457 | if (prim.ParentUUID == UUID.Zero) | 457 | if (prim.ParentUUID == UUID.Zero) |
458 | { | 458 | { |
459 | objects[prim.UUID] = new SceneObjectGroup(prim); | 459 | objects[prim.UUID] = new SceneObjectGroup(prim); |
460 | if (prim.KeyframeMotion != null) | ||
461 | prim.KeyframeMotion.UpdateSceneObject(objects[prim.UUID]); | ||
462 | } | 460 | } |
463 | } | 461 | } |
464 | 462 | ||
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index 70b76c9..c35bba2 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs | |||
@@ -732,11 +732,12 @@ namespace OpenSim.Data.SQLite | |||
732 | } | 732 | } |
733 | 733 | ||
734 | SceneObjectGroup group = new SceneObjectGroup(prim); | 734 | SceneObjectGroup group = new SceneObjectGroup(prim); |
735 | if (prim.KeyframeMotion != null) | 735 | |
736 | prim.KeyframeMotion.UpdateSceneObject(group); | ||
737 | createdObjects.Add(group.UUID, group); | 736 | createdObjects.Add(group.UUID, group); |
738 | retvals.Add(group); | 737 | retvals.Add(group); |
739 | LoadItems(prim); | 738 | LoadItems(prim); |
739 | |||
740 | |||
740 | } | 741 | } |
741 | } | 742 | } |
742 | catch (Exception e) | 743 | catch (Exception e) |
diff --git a/OpenSim/Framework/Servers/MainServer.cs b/OpenSim/Framework/Servers/MainServer.cs index cfd34bb..d189580 100644 --- a/OpenSim/Framework/Servers/MainServer.cs +++ b/OpenSim/Framework/Servers/MainServer.cs | |||
@@ -121,12 +121,14 @@ namespace OpenSim.Framework.Servers | |||
121 | + " level >= 2 then long warnings are logged when receiving bad input data.\n" | 121 | + " level >= 2 then long warnings are logged when receiving bad input data.\n" |
122 | + " level >= 3 then short notices about all incoming non-poll HTTP requests are logged.\n" | 122 | + " level >= 3 then short notices about all incoming non-poll HTTP requests are logged.\n" |
123 | + " level >= 4 then the time taken to fulfill the request is logged.\n" | 123 | + " level >= 4 then the time taken to fulfill the request is logged.\n" |
124 | + " level >= 5 then a sample from the beginning of the incoming data is logged.\n" | 124 | + " level >= 5 then a sample from the beginning of the data is logged.\n" |
125 | + " level >= 6 then the entire incoming data is logged.\n" | 125 | + " level >= 6 then the entire data is logged.\n" |
126 | + " no level is specified then the current level is returned.\n\n" | 126 | + " no level is specified then the current level is returned.\n\n" |
127 | + "If out or all and\n" | 127 | + "If out or all and\n" |
128 | + " level >= 3 then short notices about all outgoing requests going through WebUtil are logged.\n" | 128 | + " level >= 3 then short notices about all outgoing requests going through WebUtil are logged.\n" |
129 | + " level >= 4 then the time taken to fulfill the request is logged.\n", | 129 | + " level >= 4 then the time taken to fulfill the request is logged.\n" |
130 | + " level >= 5 then a sample from the beginning of the data is logged.\n" | ||
131 | + " level >= 6 then the entire data is logged.\n", | ||
130 | HandleDebugHttpCommand); | 132 | HandleDebugHttpCommand); |
131 | } | 133 | } |
132 | 134 | ||
diff --git a/OpenSim/Framework/WebUtil.cs b/OpenSim/Framework/WebUtil.cs index 701fbb0..4599f62 100644 --- a/OpenSim/Framework/WebUtil.cs +++ b/OpenSim/Framework/WebUtil.cs | |||
@@ -151,6 +151,39 @@ namespace OpenSim.Framework | |||
151 | } | 151 | } |
152 | } | 152 | } |
153 | 153 | ||
154 | public static void LogOutgoingDetail(Stream outputStream) | ||
155 | { | ||
156 | using (StreamReader reader = new StreamReader(Util.Copy(outputStream), Encoding.UTF8)) | ||
157 | { | ||
158 | string output; | ||
159 | |||
160 | if (DebugLevel == 5) | ||
161 | { | ||
162 | const int sampleLength = 80; | ||
163 | char[] sampleChars = new char[sampleLength]; | ||
164 | reader.Read(sampleChars, 0, sampleLength); | ||
165 | output = new string(sampleChars); | ||
166 | } | ||
167 | else | ||
168 | { | ||
169 | output = reader.ReadToEnd(); | ||
170 | } | ||
171 | |||
172 | LogOutgoingDetail(output); | ||
173 | } | ||
174 | } | ||
175 | |||
176 | public static void LogOutgoingDetail(string output) | ||
177 | { | ||
178 | if (DebugLevel == 5) | ||
179 | { | ||
180 | output = output.Substring(0, 80); | ||
181 | output = output + "..."; | ||
182 | } | ||
183 | |||
184 | m_log.DebugFormat("[WEB UTIL]: {0}", output.Replace("\n", @"\n")); | ||
185 | } | ||
186 | |||
154 | private static OSDMap ServiceOSDRequestWorker(string url, OSDMap data, string method, int timeout, bool compressed) | 187 | private static OSDMap ServiceOSDRequestWorker(string url, OSDMap data, string method, int timeout, bool compressed) |
155 | { | 188 | { |
156 | int reqnum = RequestNumber++; | 189 | int reqnum = RequestNumber++; |
@@ -178,7 +211,11 @@ namespace OpenSim.Framework | |||
178 | // If there is some input, write it into the request | 211 | // If there is some input, write it into the request |
179 | if (data != null) | 212 | if (data != null) |
180 | { | 213 | { |
181 | strBuffer = OSDParser.SerializeJsonString(data); | 214 | strBuffer = OSDParser.SerializeJsonString(data); |
215 | |||
216 | if (DebugLevel >= 5) | ||
217 | LogOutgoingDetail(strBuffer); | ||
218 | |||
182 | byte[] buffer = System.Text.Encoding.UTF8.GetBytes(strBuffer); | 219 | byte[] buffer = System.Text.Encoding.UTF8.GetBytes(strBuffer); |
183 | 220 | ||
184 | if (compressed) | 221 | if (compressed) |
@@ -357,6 +394,10 @@ namespace OpenSim.Framework | |||
357 | if (data != null) | 394 | if (data != null) |
358 | { | 395 | { |
359 | queryString = BuildQueryString(data); | 396 | queryString = BuildQueryString(data); |
397 | |||
398 | if (DebugLevel >= 5) | ||
399 | LogOutgoingDetail(queryString); | ||
400 | |||
360 | byte[] buffer = System.Text.Encoding.UTF8.GetBytes(queryString); | 401 | byte[] buffer = System.Text.Encoding.UTF8.GetBytes(queryString); |
361 | 402 | ||
362 | request.ContentLength = buffer.Length; | 403 | request.ContentLength = buffer.Length; |
@@ -767,6 +808,9 @@ namespace OpenSim.Framework | |||
767 | int length = (int)buffer.Length; | 808 | int length = (int)buffer.Length; |
768 | request.ContentLength = length; | 809 | request.ContentLength = length; |
769 | 810 | ||
811 | if (WebUtil.DebugLevel >= 5) | ||
812 | WebUtil.LogOutgoingDetail(buffer); | ||
813 | |||
770 | request.BeginGetRequestStream(delegate(IAsyncResult res) | 814 | request.BeginGetRequestStream(delegate(IAsyncResult res) |
771 | { | 815 | { |
772 | Stream requestStream = request.EndGetRequestStream(res); | 816 | Stream requestStream = request.EndGetRequestStream(res); |
@@ -954,6 +998,9 @@ namespace OpenSim.Framework | |||
954 | length = (int)obj.Length; | 998 | length = (int)obj.Length; |
955 | request.ContentLength = length; | 999 | request.ContentLength = length; |
956 | 1000 | ||
1001 | if (WebUtil.DebugLevel >= 5) | ||
1002 | WebUtil.LogOutgoingDetail(buffer); | ||
1003 | |||
957 | Stream requestStream = null; | 1004 | Stream requestStream = null; |
958 | try | 1005 | try |
959 | { | 1006 | { |
@@ -1096,6 +1143,9 @@ namespace OpenSim.Framework | |||
1096 | int length = (int)buffer.Length; | 1143 | int length = (int)buffer.Length; |
1097 | request.ContentLength = length; | 1144 | request.ContentLength = length; |
1098 | 1145 | ||
1146 | if (WebUtil.DebugLevel >= 5) | ||
1147 | WebUtil.LogOutgoingDetail(buffer); | ||
1148 | |||
1099 | Stream requestStream = null; | 1149 | Stream requestStream = null; |
1100 | try | 1150 | try |
1101 | { | 1151 | { |
@@ -1198,4 +1248,4 @@ namespace OpenSim.Framework | |||
1198 | return deserial; | 1248 | return deserial; |
1199 | } | 1249 | } |
1200 | } | 1250 | } |
1201 | } | 1251 | } \ No newline at end of file |
diff --git a/OpenSim/Region/DataSnapshot/DataRequestHandler.cs b/OpenSim/Region/DataSnapshot/DataRequestHandler.cs index 32e93b4..50276ae 100644 --- a/OpenSim/Region/DataSnapshot/DataRequestHandler.cs +++ b/OpenSim/Region/DataSnapshot/DataRequestHandler.cs | |||
@@ -63,7 +63,7 @@ namespace OpenSim.Region.DataSnapshot | |||
63 | 63 | ||
64 | public Hashtable OnGetSnapshot(Hashtable keysvals) | 64 | public Hashtable OnGetSnapshot(Hashtable keysvals) |
65 | { | 65 | { |
66 | m_log.Info("[DATASNAPSHOT] Received collection request"); | 66 | m_log.Debug("[DATASNAPSHOT] Received collection request"); |
67 | Hashtable reply = new Hashtable(); | 67 | Hashtable reply = new Hashtable(); |
68 | int statuscode = 200; | 68 | int statuscode = 200; |
69 | 69 | ||
@@ -80,7 +80,7 @@ namespace OpenSim.Region.DataSnapshot | |||
80 | 80 | ||
81 | public Hashtable OnValidate(Hashtable keysvals) | 81 | public Hashtable OnValidate(Hashtable keysvals) |
82 | { | 82 | { |
83 | m_log.Info("[DATASNAPSHOT] Received validation request"); | 83 | m_log.Debug("[DATASNAPSHOT] Received validation request"); |
84 | Hashtable reply = new Hashtable(); | 84 | Hashtable reply = new Hashtable(); |
85 | int statuscode = 200; | 85 | int statuscode = 200; |
86 | 86 | ||
diff --git a/OpenSim/Region/DataSnapshot/SnapshotStore.cs b/OpenSim/Region/DataSnapshot/SnapshotStore.cs index aa3d2ff..480aaaf 100644 --- a/OpenSim/Region/DataSnapshot/SnapshotStore.cs +++ b/OpenSim/Region/DataSnapshot/SnapshotStore.cs | |||
@@ -120,7 +120,7 @@ namespace OpenSim.Region.DataSnapshot | |||
120 | provider.Stale = false; | 120 | provider.Stale = false; |
121 | m_scenes[provider.GetParentScene] = true; | 121 | m_scenes[provider.GetParentScene] = true; |
122 | 122 | ||
123 | m_log.Info("[DATASNAPSHOT]: Generated fragment response for provider type " + provider.Name); | 123 | m_log.Debug("[DATASNAPSHOT]: Generated fragment response for provider type " + provider.Name); |
124 | } | 124 | } |
125 | else | 125 | else |
126 | { | 126 | { |
@@ -134,7 +134,7 @@ namespace OpenSim.Region.DataSnapshot | |||
134 | data = factory.ImportNode(node, true); | 134 | data = factory.ImportNode(node, true); |
135 | } | 135 | } |
136 | 136 | ||
137 | m_log.Info("[DATASNAPSHOT]: Retrieved fragment response for provider type " + provider.Name); | 137 | m_log.Debug("[DATASNAPSHOT]: Retrieved fragment response for provider type " + provider.Name); |
138 | } | 138 | } |
139 | 139 | ||
140 | return data; | 140 | return data; |
@@ -154,7 +154,7 @@ namespace OpenSim.Region.DataSnapshot | |||
154 | 154 | ||
155 | if (!m_scenes[scene]) | 155 | if (!m_scenes[scene]) |
156 | { | 156 | { |
157 | m_log.Info("[DATASNAPSHOT]: Attempting to retrieve snapshot from cache."); | 157 | m_log.Debug("[DATASNAPSHOT]: Attempting to retrieve snapshot from cache."); |
158 | //get snapshot from cache | 158 | //get snapshot from cache |
159 | String path = DataFileNameScene(scene); | 159 | String path = DataFileNameScene(scene); |
160 | 160 | ||
@@ -168,11 +168,11 @@ namespace OpenSim.Region.DataSnapshot | |||
168 | regionElement = factory.ImportNode(node, true); | 168 | regionElement = factory.ImportNode(node, true); |
169 | } | 169 | } |
170 | 170 | ||
171 | m_log.Info("[DATASNAPSHOT]: Obtained snapshot from cache for " + scene.RegionInfo.RegionName); | 171 | m_log.Debug("[DATASNAPSHOT]: Obtained snapshot from cache for " + scene.RegionInfo.RegionName); |
172 | } | 172 | } |
173 | else | 173 | else |
174 | { | 174 | { |
175 | m_log.Info("[DATASNAPSHOT]: Attempting to generate snapshot."); | 175 | m_log.Debug("[DATASNAPSHOT]: Attempting to generate snapshot."); |
176 | //make snapshot | 176 | //make snapshot |
177 | regionElement = MakeRegionNode(scene, factory); | 177 | regionElement = MakeRegionNode(scene, factory); |
178 | 178 | ||
@@ -211,7 +211,7 @@ namespace OpenSim.Region.DataSnapshot | |||
211 | 211 | ||
212 | m_scenes[scene] = false; | 212 | m_scenes[scene] = false; |
213 | 213 | ||
214 | m_log.Info("[DATASNAPSHOT]: Generated new snapshot for " + scene.RegionInfo.RegionName); | 214 | m_log.Debug("[DATASNAPSHOT]: Generated new snapshot for " + scene.RegionInfo.RegionName); |
215 | } | 215 | } |
216 | 216 | ||
217 | return regionElement; | 217 | return regionElement; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index da80e4f..7b5fdcb 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -763,6 +763,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
763 | for (int i = 0; i < parts.Length; i++) | 763 | for (int i = 0; i < parts.Length; i++) |
764 | { | 764 | { |
765 | SceneObjectPart part = parts[i]; | 765 | SceneObjectPart part = parts[i]; |
766 | if (part.KeyframeMotion != null) | ||
767 | { | ||
768 | part.KeyframeMotion.UpdateSceneObject(this); | ||
769 | } | ||
770 | |||
766 | if (Object.ReferenceEquals(part, m_rootPart)) | 771 | if (Object.ReferenceEquals(part, m_rootPart)) |
767 | continue; | 772 | continue; |
768 | 773 | ||
diff --git a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs index 64127c2..9d28dc3 100644 --- a/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs +++ b/OpenSim/Server/Handlers/Inventory/XInventoryInConnector.cs | |||
@@ -155,7 +155,7 @@ namespace OpenSim.Server.Handlers.Asset | |||
155 | } | 155 | } |
156 | catch (Exception e) | 156 | catch (Exception e) |
157 | { | 157 | { |
158 | m_log.DebugFormat("[XINVENTORY HANDLER]: Exception {0}", e.StackTrace); | 158 | m_log.ErrorFormat("[XINVENTORY HANDLER]: Exception {0}", e.StackTrace); |
159 | } | 159 | } |
160 | 160 | ||
161 | return FailureResult(); | 161 | return FailureResult(); |
diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs index 44f5e01..36d4ae2 100644 --- a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs +++ b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs | |||
@@ -84,6 +84,30 @@ namespace OpenSim.Services.Connectors | |||
84 | m_ServerURI = serviceURI; | 84 | m_ServerURI = serviceURI; |
85 | } | 85 | } |
86 | 86 | ||
87 | private bool CheckReturn(Dictionary<string, object> ret) | ||
88 | { | ||
89 | if (ret == null) | ||
90 | return false; | ||
91 | |||
92 | if (ret.Count == 0) | ||
93 | return false; | ||
94 | |||
95 | if (ret.ContainsKey("RESULT")) | ||
96 | { | ||
97 | if (ret["RESULT"] is string) | ||
98 | { | ||
99 | bool result; | ||
100 | |||
101 | if (bool.TryParse((string)ret["RESULT"], out result)) | ||
102 | return result; | ||
103 | |||
104 | return false; | ||
105 | } | ||
106 | } | ||
107 | |||
108 | return true; | ||
109 | } | ||
110 | |||
87 | public bool CreateUserInventory(UUID principalID) | 111 | public bool CreateUserInventory(UUID principalID) |
88 | { | 112 | { |
89 | Dictionary<string,object> ret = MakeRequest("CREATEUSERINVENTORY", | 113 | Dictionary<string,object> ret = MakeRequest("CREATEUSERINVENTORY", |
@@ -91,12 +115,7 @@ namespace OpenSim.Services.Connectors | |||
91 | { "PRINCIPAL", principalID.ToString() } | 115 | { "PRINCIPAL", principalID.ToString() } |
92 | }); | 116 | }); |
93 | 117 | ||
94 | if (ret == null) | 118 | return CheckReturn(ret); |
95 | return false; | ||
96 | if (ret.Count == 0) | ||
97 | return false; | ||
98 | |||
99 | return bool.Parse(ret["RESULT"].ToString()); | ||
100 | } | 119 | } |
101 | 120 | ||
102 | public List<InventoryFolderBase> GetInventorySkeleton(UUID principalID) | 121 | public List<InventoryFolderBase> GetInventorySkeleton(UUID principalID) |
@@ -106,9 +125,7 @@ namespace OpenSim.Services.Connectors | |||
106 | { "PRINCIPAL", principalID.ToString() } | 125 | { "PRINCIPAL", principalID.ToString() } |
107 | }); | 126 | }); |
108 | 127 | ||
109 | if (ret == null) | 128 | if (!CheckReturn(ret)) |
110 | return null; | ||
111 | if (ret.Count == 0) | ||
112 | return null; | 129 | return null; |
113 | 130 | ||
114 | Dictionary<string, object> folders = (Dictionary<string, object>)ret["FOLDERS"]; | 131 | Dictionary<string, object> folders = (Dictionary<string, object>)ret["FOLDERS"]; |
@@ -135,9 +152,7 @@ namespace OpenSim.Services.Connectors | |||
135 | { "PRINCIPAL", principalID.ToString() } | 152 | { "PRINCIPAL", principalID.ToString() } |
136 | }); | 153 | }); |
137 | 154 | ||
138 | if (ret == null) | 155 | if (!CheckReturn(ret)) |
139 | return null; | ||
140 | if (ret.Count == 0) | ||
141 | return null; | 156 | return null; |
142 | 157 | ||
143 | return BuildFolder((Dictionary<string, object>)ret["folder"]); | 158 | return BuildFolder((Dictionary<string, object>)ret["folder"]); |
@@ -151,9 +166,7 @@ namespace OpenSim.Services.Connectors | |||
151 | { "TYPE", ((int)type).ToString() } | 166 | { "TYPE", ((int)type).ToString() } |
152 | }); | 167 | }); |
153 | 168 | ||
154 | if (ret == null) | 169 | if (!CheckReturn(ret)) |
155 | return null; | ||
156 | if (ret.Count == 0) | ||
157 | return null; | 170 | return null; |
158 | 171 | ||
159 | return BuildFolder((Dictionary<string, object>)ret["folder"]); | 172 | return BuildFolder((Dictionary<string, object>)ret["folder"]); |
@@ -174,9 +187,7 @@ namespace OpenSim.Services.Connectors | |||
174 | { "FOLDER", folderID.ToString() } | 187 | { "FOLDER", folderID.ToString() } |
175 | }); | 188 | }); |
176 | 189 | ||
177 | if (ret == null) | 190 | if (!CheckReturn(ret)) |
178 | return null; | ||
179 | if (ret.Count == 0) | ||
180 | return null; | 191 | return null; |
181 | 192 | ||
182 | Dictionary<string,object> folders = | 193 | Dictionary<string,object> folders = |
@@ -205,9 +216,7 @@ namespace OpenSim.Services.Connectors | |||
205 | { "FOLDER", folderID.ToString() } | 216 | { "FOLDER", folderID.ToString() } |
206 | }); | 217 | }); |
207 | 218 | ||
208 | if (ret == null) | 219 | if (!CheckReturn(ret)) |
209 | return null; | ||
210 | if (ret.Count == 0) | ||
211 | return null; | 220 | return null; |
212 | 221 | ||
213 | Dictionary<string, object> items = (Dictionary<string, object>)ret["ITEMS"]; | 222 | Dictionary<string, object> items = (Dictionary<string, object>)ret["ITEMS"]; |
@@ -230,10 +239,7 @@ namespace OpenSim.Services.Connectors | |||
230 | { "ID", folder.ID.ToString() } | 239 | { "ID", folder.ID.ToString() } |
231 | }); | 240 | }); |
232 | 241 | ||
233 | if (ret == null) | 242 | return CheckReturn(ret); |
234 | return false; | ||
235 | |||
236 | return bool.Parse(ret["RESULT"].ToString()); | ||
237 | } | 243 | } |
238 | 244 | ||
239 | public bool UpdateFolder(InventoryFolderBase folder) | 245 | public bool UpdateFolder(InventoryFolderBase folder) |
@@ -248,10 +254,7 @@ namespace OpenSim.Services.Connectors | |||
248 | { "ID", folder.ID.ToString() } | 254 | { "ID", folder.ID.ToString() } |
249 | }); | 255 | }); |
250 | 256 | ||
251 | if (ret == null) | 257 | return CheckReturn(ret); |
252 | return false; | ||
253 | |||
254 | return bool.Parse(ret["RESULT"].ToString()); | ||
255 | } | 258 | } |
256 | 259 | ||
257 | public bool MoveFolder(InventoryFolderBase folder) | 260 | public bool MoveFolder(InventoryFolderBase folder) |
@@ -263,10 +266,7 @@ namespace OpenSim.Services.Connectors | |||
263 | { "PRINCIPAL", folder.Owner.ToString() } | 266 | { "PRINCIPAL", folder.Owner.ToString() } |
264 | }); | 267 | }); |
265 | 268 | ||
266 | if (ret == null) | 269 | return CheckReturn(ret); |
267 | return false; | ||
268 | |||
269 | return bool.Parse(ret["RESULT"].ToString()); | ||
270 | } | 270 | } |
271 | 271 | ||
272 | public bool DeleteFolders(UUID principalID, List<UUID> folderIDs) | 272 | public bool DeleteFolders(UUID principalID, List<UUID> folderIDs) |
@@ -282,10 +282,7 @@ namespace OpenSim.Services.Connectors | |||
282 | { "FOLDERS", slist } | 282 | { "FOLDERS", slist } |
283 | }); | 283 | }); |
284 | 284 | ||
285 | if (ret == null) | 285 | return CheckReturn(ret); |
286 | return false; | ||
287 | |||
288 | return bool.Parse(ret["RESULT"].ToString()); | ||
289 | } | 286 | } |
290 | 287 | ||
291 | public bool PurgeFolder(InventoryFolderBase folder) | 288 | public bool PurgeFolder(InventoryFolderBase folder) |
@@ -295,10 +292,7 @@ namespace OpenSim.Services.Connectors | |||
295 | { "ID", folder.ID.ToString() } | 292 | { "ID", folder.ID.ToString() } |
296 | }); | 293 | }); |
297 | 294 | ||
298 | if (ret == null) | 295 | return CheckReturn(ret); |
299 | return false; | ||
300 | |||
301 | return bool.Parse(ret["RESULT"].ToString()); | ||
302 | } | 296 | } |
303 | 297 | ||
304 | public bool AddItem(InventoryItemBase item) | 298 | public bool AddItem(InventoryItemBase item) |
@@ -330,10 +324,7 @@ namespace OpenSim.Services.Connectors | |||
330 | { "CreationDate", item.CreationDate.ToString() } | 324 | { "CreationDate", item.CreationDate.ToString() } |
331 | }); | 325 | }); |
332 | 326 | ||
333 | if (ret == null) | 327 | return CheckReturn(ret); |
334 | return false; | ||
335 | |||
336 | return bool.Parse(ret["RESULT"].ToString()); | ||
337 | } | 328 | } |
338 | 329 | ||
339 | public bool UpdateItem(InventoryItemBase item) | 330 | public bool UpdateItem(InventoryItemBase item) |
@@ -365,10 +356,7 @@ namespace OpenSim.Services.Connectors | |||
365 | { "CreationDate", item.CreationDate.ToString() } | 356 | { "CreationDate", item.CreationDate.ToString() } |
366 | }); | 357 | }); |
367 | 358 | ||
368 | if (ret == null) | 359 | return CheckReturn(ret); |
369 | return false; | ||
370 | |||
371 | return bool.Parse(ret["RESULT"].ToString()); | ||
372 | } | 360 | } |
373 | 361 | ||
374 | public bool MoveItems(UUID principalID, List<InventoryItemBase> items) | 362 | public bool MoveItems(UUID principalID, List<InventoryItemBase> items) |
@@ -389,10 +377,7 @@ namespace OpenSim.Services.Connectors | |||
389 | { "DESTLIST", destlist } | 377 | { "DESTLIST", destlist } |
390 | }); | 378 | }); |
391 | 379 | ||
392 | if (ret == null) | 380 | return CheckReturn(ret); |
393 | return false; | ||
394 | |||
395 | return bool.Parse(ret["RESULT"].ToString()); | ||
396 | } | 381 | } |
397 | 382 | ||
398 | public bool DeleteItems(UUID principalID, List<UUID> itemIDs) | 383 | public bool DeleteItems(UUID principalID, List<UUID> itemIDs) |
@@ -408,10 +393,7 @@ namespace OpenSim.Services.Connectors | |||
408 | { "ITEMS", slist } | 393 | { "ITEMS", slist } |
409 | }); | 394 | }); |
410 | 395 | ||
411 | if (ret == null) | 396 | return CheckReturn(ret); |
412 | return false; | ||
413 | |||
414 | return bool.Parse(ret["RESULT"].ToString()); | ||
415 | } | 397 | } |
416 | 398 | ||
417 | public InventoryItemBase GetItem(InventoryItemBase item) | 399 | public InventoryItemBase GetItem(InventoryItemBase item) |
@@ -423,9 +405,7 @@ namespace OpenSim.Services.Connectors | |||
423 | { "ID", item.ID.ToString() } | 405 | { "ID", item.ID.ToString() } |
424 | }); | 406 | }); |
425 | 407 | ||
426 | if (ret == null) | 408 | if (!CheckReturn(ret)) |
427 | return null; | ||
428 | if (ret.Count == 0) | ||
429 | return null; | 409 | return null; |
430 | 410 | ||
431 | return BuildItem((Dictionary<string, object>)ret["item"]); | 411 | return BuildItem((Dictionary<string, object>)ret["item"]); |
@@ -447,9 +427,7 @@ namespace OpenSim.Services.Connectors | |||
447 | { "ID", folder.ID.ToString() } | 427 | { "ID", folder.ID.ToString() } |
448 | }); | 428 | }); |
449 | 429 | ||
450 | if (ret == null) | 430 | if (!CheckReturn(ret)) |
451 | return null; | ||
452 | if (ret.Count == 0) | ||
453 | return null; | 431 | return null; |
454 | 432 | ||
455 | return BuildFolder((Dictionary<string, object>)ret["folder"]); | 433 | return BuildFolder((Dictionary<string, object>)ret["folder"]); |
@@ -469,7 +447,7 @@ namespace OpenSim.Services.Connectors | |||
469 | { "PRINCIPAL", principalID.ToString() } | 447 | { "PRINCIPAL", principalID.ToString() } |
470 | }); | 448 | }); |
471 | 449 | ||
472 | if (ret == null) | 450 | if (!CheckReturn(ret)) |
473 | return null; | 451 | return null; |
474 | 452 | ||
475 | List<InventoryItemBase> items = new List<InventoryItemBase>(); | 453 | List<InventoryItemBase> items = new List<InventoryItemBase>(); |
@@ -488,10 +466,22 @@ namespace OpenSim.Services.Connectors | |||
488 | { "ASSET", assetID.ToString() } | 466 | { "ASSET", assetID.ToString() } |
489 | }); | 467 | }); |
490 | 468 | ||
469 | // We cannot use CheckReturn() here because valid values for RESULT are "false" (in the case of request failure) or an int | ||
491 | if (ret == null) | 470 | if (ret == null) |
492 | return 0; | 471 | return 0; |
493 | 472 | ||
494 | return int.Parse(ret["RESULT"].ToString()); | 473 | if (ret.ContainsKey("RESULT")) |
474 | { | ||
475 | if (ret["RESULT"] is string) | ||
476 | { | ||
477 | int intResult; | ||
478 | |||
479 | if (int.TryParse ((string)ret["RESULT"], out intResult)) | ||
480 | return intResult; | ||
481 | } | ||
482 | } | ||
483 | |||
484 | return 0; | ||
495 | } | 485 | } |
496 | 486 | ||
497 | public InventoryCollection GetUserInventory(UUID principalID) | 487 | public InventoryCollection GetUserInventory(UUID principalID) |
@@ -508,9 +498,7 @@ namespace OpenSim.Services.Connectors | |||
508 | { "PRINCIPAL", principalID.ToString() } | 498 | { "PRINCIPAL", principalID.ToString() } |
509 | }); | 499 | }); |
510 | 500 | ||
511 | if (ret == null) | 501 | if (!CheckReturn(ret)) |
512 | return null; | ||
513 | if (ret.Count == 0) | ||
514 | return null; | 502 | return null; |
515 | 503 | ||
516 | Dictionary<string, object> folders = | 504 | Dictionary<string, object> folders = |
diff --git a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs index eecf757..410916f 100644 --- a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs +++ b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs | |||
@@ -115,6 +115,12 @@ namespace OpenSim.Services.HypergridService | |||
115 | { | 115 | { |
116 | XInventoryFolder suitcase = GetSuitcaseXFolder(principalID); | 116 | XInventoryFolder suitcase = GetSuitcaseXFolder(principalID); |
117 | 117 | ||
118 | if (suitcase == null) | ||
119 | { | ||
120 | m_log.WarnFormat("[HG SUITCASE INVENTORY SERVICE]: Found no suitcase folder for user {0} when looking for inventory skeleton", principalID); | ||
121 | return null; | ||
122 | } | ||
123 | |||
118 | List<XInventoryFolder> tree = GetFolderTree(principalID, suitcase.folderID); | 124 | List<XInventoryFolder> tree = GetFolderTree(principalID, suitcase.folderID); |
119 | if (tree == null || (tree != null && tree.Count == 0)) | 125 | if (tree == null || (tree != null && tree.Count == 0)) |
120 | return null; | 126 | return null; |
@@ -134,6 +140,7 @@ namespace OpenSim.Services.HypergridService | |||
134 | public override InventoryCollection GetUserInventory(UUID userID) | 140 | public override InventoryCollection GetUserInventory(UUID userID) |
135 | { | 141 | { |
136 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Get Suitcase inventory for user {0}", userID); | 142 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Get Suitcase inventory for user {0}", userID); |
143 | |||
137 | InventoryCollection userInventory = new InventoryCollection(); | 144 | InventoryCollection userInventory = new InventoryCollection(); |
138 | userInventory.UserID = userID; | 145 | userInventory.UserID = userID; |
139 | userInventory.Folders = new List<InventoryFolderBase>(); | 146 | userInventory.Folders = new List<InventoryFolderBase>(); |
@@ -141,6 +148,12 @@ namespace OpenSim.Services.HypergridService | |||
141 | 148 | ||
142 | XInventoryFolder suitcase = GetSuitcaseXFolder(userID); | 149 | XInventoryFolder suitcase = GetSuitcaseXFolder(userID); |
143 | 150 | ||
151 | if (suitcase == null) | ||
152 | { | ||
153 | m_log.WarnFormat("[HG SUITCASE INVENTORY SERVICE]: Found no suitcase folder for user {0} when looking for user inventory", userID); | ||
154 | return null; | ||
155 | } | ||
156 | |||
144 | List<XInventoryFolder> tree = GetFolderTree(userID, suitcase.folderID); | 157 | List<XInventoryFolder> tree = GetFolderTree(userID, suitcase.folderID); |
145 | if (tree == null || (tree != null && tree.Count == 0)) | 158 | if (tree == null || (tree != null && tree.Count == 0)) |
146 | { | 159 | { |
@@ -182,7 +195,8 @@ namespace OpenSim.Services.HypergridService | |||
182 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: GetRootFolder for {0}", principalID); | 195 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: GetRootFolder for {0}", principalID); |
183 | 196 | ||
184 | // Let's find out the local root folder | 197 | // Let's find out the local root folder |
185 | XInventoryFolder root = GetRootXFolder(principalID); ; | 198 | XInventoryFolder root = GetRootXFolder(principalID); |
199 | |||
186 | if (root == null) | 200 | if (root == null) |
187 | { | 201 | { |
188 | m_log.WarnFormat("[HG SUITCASE INVENTORY SERVICE]: Unable to retrieve local root folder for user {0}", principalID); | 202 | m_log.WarnFormat("[HG SUITCASE INVENTORY SERVICE]: Unable to retrieve local root folder for user {0}", principalID); |
@@ -255,6 +269,13 @@ namespace OpenSim.Services.HypergridService | |||
255 | { | 269 | { |
256 | //m_log.DebugFormat("[HG INVENTORY SERVICE]: GetFolderForType for {0} {0}", principalID, type); | 270 | //m_log.DebugFormat("[HG INVENTORY SERVICE]: GetFolderForType for {0} {0}", principalID, type); |
257 | XInventoryFolder suitcase = GetSuitcaseXFolder(principalID); | 271 | XInventoryFolder suitcase = GetSuitcaseXFolder(principalID); |
272 | |||
273 | if (suitcase == null) | ||
274 | { | ||
275 | m_log.WarnFormat("[HG SUITCASE INVENTORY SERVICE]: Found no suitcase folder for user {0} when looking for child type folder {1}", principalID, type); | ||
276 | return null; | ||
277 | } | ||
278 | |||
258 | XInventoryFolder[] folders = m_Database.GetFolders( | 279 | XInventoryFolder[] folders = m_Database.GetFolders( |
259 | new string[] { "agentID", "type", "parentFolderID" }, | 280 | new string[] { "agentID", "type", "parentFolderID" }, |
260 | new string[] { principalID.ToString(), ((int)type).ToString(), suitcase.folderID.ToString() }); | 281 | new string[] { principalID.ToString(), ((int)type).ToString(), suitcase.folderID.ToString() }); |
@@ -546,6 +567,7 @@ namespace OpenSim.Services.HypergridService | |||
546 | private bool IsWithinSuitcaseTree(UUID principalID, UUID folderID) | 567 | private bool IsWithinSuitcaseTree(UUID principalID, UUID folderID) |
547 | { | 568 | { |
548 | XInventoryFolder suitcase = GetSuitcaseXFolder(principalID); | 569 | XInventoryFolder suitcase = GetSuitcaseXFolder(principalID); |
570 | |||
549 | if (suitcase == null) | 571 | if (suitcase == null) |
550 | { | 572 | { |
551 | m_log.WarnFormat("[HG SUITCASE INVENTORY SERVICE]: User {0} does not have a Suitcase folder", principalID); | 573 | m_log.WarnFormat("[HG SUITCASE INVENTORY SERVICE]: User {0} does not have a Suitcase folder", principalID); |