diff options
author | BlueWall | 2012-11-25 17:03:14 -0500 |
---|---|---|
committer | BlueWall | 2012-11-25 17:03:14 -0500 |
commit | c754003944d0166bf50b4f94b0c0eea642503bb0 (patch) | |
tree | dfa1c2020d5500d510519d5b2b3236600692f277 /OpenSim/Services | |
parent | Merge branch 'master' into connector_plugin (diff) | |
parent | Combine TestDeleteSceneObjectAsync() with TestDeRezSceneObject() as they are ... (diff) | |
download | opensim-SC_OLD-c754003944d0166bf50b4f94b0c0eea642503bb0.zip opensim-SC_OLD-c754003944d0166bf50b4f94b0c0eea642503bb0.tar.gz opensim-SC_OLD-c754003944d0166bf50b4f94b0c0eea642503bb0.tar.bz2 opensim-SC_OLD-c754003944d0166bf50b4f94b0c0eea642503bb0.tar.xz |
Merge branch 'master' into connector_plugin
Conflicts:
OpenSim/Server/Base/ServicesServerBase.cs
Diffstat (limited to 'OpenSim/Services')
33 files changed, 799 insertions, 839 deletions
diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs index b1f0f7e..e7eb6fe 100644 --- a/OpenSim/Services/AssetService/AssetService.cs +++ b/OpenSim/Services/AssetService/AssetService.cs | |||
@@ -70,7 +70,7 @@ namespace OpenSim.Services.AssetService | |||
70 | 70 | ||
71 | if (assetLoaderEnabled) | 71 | if (assetLoaderEnabled) |
72 | { | 72 | { |
73 | m_log.DebugFormat("[ASSET]: Loading default asset set from {0}", loaderArgs); | 73 | m_log.DebugFormat("[ASSET SERVICE]: Loading default asset set from {0}", loaderArgs); |
74 | 74 | ||
75 | m_AssetLoader.ForEachDefaultXmlAsset( | 75 | m_AssetLoader.ForEachDefaultXmlAsset( |
76 | loaderArgs, | 76 | loaderArgs, |
@@ -197,20 +197,7 @@ namespace OpenSim.Services.AssetService | |||
197 | if (!UUID.TryParse(id, out assetID)) | 197 | if (!UUID.TryParse(id, out assetID)) |
198 | return false; | 198 | return false; |
199 | 199 | ||
200 | AssetBase asset = m_Database.GetAsset(assetID); | 200 | return m_Database.Delete(id); |
201 | if (asset == null) | ||
202 | return false; | ||
203 | |||
204 | if ((int)(asset.Flags & AssetFlags.Maptile) != 0) | ||
205 | { | ||
206 | return m_Database.Delete(id); | ||
207 | } | ||
208 | else | ||
209 | { | ||
210 | m_log.DebugFormat("[ASSET SERVICE]: Request to delete asset {0}, but flags are not Maptile", id); | ||
211 | } | ||
212 | |||
213 | return false; | ||
214 | } | 201 | } |
215 | } | 202 | } |
216 | } \ No newline at end of file | 203 | } \ No newline at end of file |
diff --git a/OpenSim/Services/AssetService/Properties/AssemblyInfo.cs b/OpenSim/Services/AssetService/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..1509400 --- /dev/null +++ b/OpenSim/Services/AssetService/Properties/AssemblyInfo.cs | |||
@@ -0,0 +1,33 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("OpenSim.Services.AssetService")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("http://opensimulator.org")] | ||
12 | [assembly: AssemblyProduct("OpenSim")] | ||
13 | [assembly: AssemblyCopyright("OpenSimulator developers")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("fe57c0df-6101-4c23-ae1a-7b3e937843f9")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | [assembly: AssemblyVersion("0.7.5.*")] | ||
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | ||
diff --git a/OpenSim/Services/AssetService/XAssetService.cs b/OpenSim/Services/AssetService/XAssetService.cs index e62bcb5..a1d10ed 100644 --- a/OpenSim/Services/AssetService/XAssetService.cs +++ b/OpenSim/Services/AssetService/XAssetService.cs | |||
@@ -194,21 +194,7 @@ namespace OpenSim.Services.AssetService | |||
194 | if (!UUID.TryParse(id, out assetID)) | 194 | if (!UUID.TryParse(id, out assetID)) |
195 | return false; | 195 | return false; |
196 | 196 | ||
197 | AssetBase asset = m_Database.GetAsset(assetID); | 197 | return m_Database.Delete(id); |
198 | if (asset == null) | ||
199 | return false; | ||
200 | |||
201 | if ((int)(asset.Flags & AssetFlags.Maptile) != 0) | ||
202 | { | ||
203 | return m_Database.Delete(id); | ||
204 | } | ||
205 | else | ||
206 | { | ||
207 | m_log.DebugFormat("[XASSET SERVICE]: Request to delete asset {0}, but flags are not Maptile", id); | ||
208 | } | ||
209 | |||
210 | return false; | ||
211 | } | 198 | } |
212 | } | 199 | } |
213 | } | 200 | } \ No newline at end of file |
214 | |||
diff --git a/OpenSim/Services/AuthenticationService/Properties/AssemblyInfo.cs b/OpenSim/Services/AuthenticationService/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..0eb2ba7 --- /dev/null +++ b/OpenSim/Services/AuthenticationService/Properties/AssemblyInfo.cs | |||
@@ -0,0 +1,33 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("OpenSim.Services.AuthenticationService")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("http://opensimulator.org")] | ||
12 | [assembly: AssemblyProduct("OpenSim")] | ||
13 | [assembly: AssemblyCopyright("Copyright © 2012")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("74497b6f-8844-4ed4-8f0d-2caf7f42b760")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | [assembly: AssemblyVersion("0.7.5.*")] | ||
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | ||
diff --git a/OpenSim/Services/AuthorizationService/Properties/AssemblyInfo.cs b/OpenSim/Services/AuthorizationService/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..6d6b11e --- /dev/null +++ b/OpenSim/Services/AuthorizationService/Properties/AssemblyInfo.cs | |||
@@ -0,0 +1,33 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("OpenSim.Services.AuthorizationService")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("http://opensimulator.org")] | ||
12 | [assembly: AssemblyProduct("OpenSim")] | ||
13 | [assembly: AssemblyCopyright("OpenSimulator developers")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("822586bb-cf25-4a2a-ac3e-59edaf147be3")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | [assembly: AssemblyVersion("0.7.5.*")] | ||
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | ||
diff --git a/OpenSim/Services/AvatarService/Properties/AssemblyInfo.cs b/OpenSim/Services/AvatarService/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..0944149 --- /dev/null +++ b/OpenSim/Services/AvatarService/Properties/AssemblyInfo.cs | |||
@@ -0,0 +1,33 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("OpenSim.Services.AvatarService")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("http://opensimulator.org")] | ||
12 | [assembly: AssemblyProduct("OpenSim")] | ||
13 | [assembly: AssemblyCopyright("OpenSimulator developers")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("0c9462ad-a5f3-46d1-ae9e-d6901fa33aa4")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | [assembly: AssemblyVersion("0.7.5.*")] | ||
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | ||
diff --git a/OpenSim/Services/Base/Properties/AssemblyInfo.cs b/OpenSim/Services/Base/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..306b699 --- /dev/null +++ b/OpenSim/Services/Base/Properties/AssemblyInfo.cs | |||
@@ -0,0 +1,33 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("OpenSim.Services.Base")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("http://opensimulator.org")] | ||
12 | [assembly: AssemblyProduct("OpenSim")] | ||
13 | [assembly: AssemblyCopyright("OpenSimulator developers")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("db9f6f73-3a56-497f-a465-4bea9cb86062")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | [assembly: AssemblyVersion("0.7.5.*")] | ||
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | ||
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index 19dffc3..5bcff48 100644 --- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs | |||
@@ -321,7 +321,7 @@ namespace OpenSim.Services.Connectors.Hypergrid | |||
321 | args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); | 321 | args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); |
322 | args["teleport_flags"] = OSD.FromString(flags.ToString()); | 322 | args["teleport_flags"] = OSD.FromString(flags.ToString()); |
323 | 323 | ||
324 | OSDMap result = WebUtil.PostToService(uri, args, 20000); | 324 | OSDMap result = WebUtil.PostToService(uri, args, 80000); |
325 | if (result["Success"].AsBoolean()) | 325 | if (result["Success"].AsBoolean()) |
326 | { | 326 | { |
327 | OSDMap unpacked = (OSDMap)result["_Result"]; | 327 | OSDMap unpacked = (OSDMap)result["_Result"]; |
diff --git a/OpenSim/Services/Connectors/Properties/AssemblyInfo.cs b/OpenSim/Services/Connectors/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..bfb681b --- /dev/null +++ b/OpenSim/Services/Connectors/Properties/AssemblyInfo.cs | |||
@@ -0,0 +1,33 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("OpenSim.Services.Connectors")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("http://opensimulator.org")] | ||
12 | [assembly: AssemblyProduct("OpenSim")] | ||
13 | [assembly: AssemblyCopyright("OpenSimulator developers")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("3ab0a9a1-3f45-4c07-a892-3848df8c0173")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | [assembly: AssemblyVersion("0.7.5.*")] | ||
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | ||
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs index 6bfc5cc..63a32e7 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAssetServiceConnector.cs | |||
@@ -45,7 +45,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
45 | /// <summary> | 45 | /// <summary> |
46 | /// Connects to the SimianGrid asset service | 46 | /// Connects to the SimianGrid asset service |
47 | /// </summary> | 47 | /// </summary> |
48 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 48 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "SimianAssetServiceConnector")] |
49 | public class SimianAssetServiceConnector : IAssetService, ISharedRegionModule | 49 | public class SimianAssetServiceConnector : IAssetService, ISharedRegionModule |
50 | { | 50 | { |
51 | private static readonly ILog m_log = | 51 | private static readonly ILog m_log = |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs index 69f6ed2..6603f6e 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAuthenticationServiceConnector.cs | |||
@@ -43,7 +43,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
43 | /// <summary> | 43 | /// <summary> |
44 | /// Connects authentication/authorization to the SimianGrid backend | 44 | /// Connects authentication/authorization to the SimianGrid backend |
45 | /// </summary> | 45 | /// </summary> |
46 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 46 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "SimianAuthenticationServiceConnector")] |
47 | public class SimianAuthenticationServiceConnector : IAuthenticationService, ISharedRegionModule | 47 | public class SimianAuthenticationServiceConnector : IAuthenticationService, ISharedRegionModule |
48 | { | 48 | { |
49 | private static readonly ILog m_log = | 49 | private static readonly ILog m_log = |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs index 360f0dd..841bfa0 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianAvatarServiceConnector.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
47 | /// <summary> | 47 | /// <summary> |
48 | /// Connects avatar appearance data to the SimianGrid backend | 48 | /// Connects avatar appearance data to the SimianGrid backend |
49 | /// </summary> | 49 | /// </summary> |
50 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 50 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "SimianAvatarServiceConnector")] |
51 | public class SimianAvatarServiceConnector : IAvatarService, ISharedRegionModule | 51 | public class SimianAvatarServiceConnector : IAvatarService, ISharedRegionModule |
52 | { | 52 | { |
53 | private static readonly ILog m_log = | 53 | private static readonly ILog m_log = |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs index f828abb..a391275 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianInventoryServiceConnector.cs | |||
@@ -59,7 +59,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
59 | /// <summary> | 59 | /// <summary> |
60 | /// Connects avatar inventories to the SimianGrid backend | 60 | /// Connects avatar inventories to the SimianGrid backend |
61 | /// </summary> | 61 | /// </summary> |
62 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 62 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "SimianInventoryServiceConnector")] |
63 | public class SimianInventoryServiceConnector : IInventoryService, ISharedRegionModule | 63 | public class SimianInventoryServiceConnector : IInventoryService, ISharedRegionModule |
64 | { | 64 | { |
65 | private static readonly ILog m_log = | 65 | private static readonly ILog m_log = |
@@ -781,7 +781,6 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
781 | invItem.CreationDate = item["CreationDate"].AsInteger(); | 781 | invItem.CreationDate = item["CreationDate"].AsInteger(); |
782 | invItem.CreatorId = item["CreatorID"].AsString(); | 782 | invItem.CreatorId = item["CreatorID"].AsString(); |
783 | invItem.CreatorData = item["CreatorData"].AsString(); | 783 | invItem.CreatorData = item["CreatorData"].AsString(); |
784 | invItem.CreatorIdAsUuid = item["CreatorID"].AsUUID(); | ||
785 | invItem.Description = item["Description"].AsString(); | 784 | invItem.Description = item["Description"].AsString(); |
786 | invItem.Folder = item["ParentID"].AsUUID(); | 785 | invItem.Folder = item["ParentID"].AsUUID(); |
787 | invItem.ID = item["ID"].AsUUID(); | 786 | invItem.ID = item["ID"].AsUUID(); |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs index ca1b64f..854bea4 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianPresenceServiceConnector.cs | |||
@@ -47,7 +47,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
47 | /// Connects avatar presence information (for tracking current location and | 47 | /// Connects avatar presence information (for tracking current location and |
48 | /// message routing) to the SimianGrid backend | 48 | /// message routing) to the SimianGrid backend |
49 | /// </summary> | 49 | /// </summary> |
50 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 50 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "SimianPresenceServiceConnector")] |
51 | public class SimianPresenceServiceConnector : IPresenceService, IGridUserService, ISharedRegionModule | 51 | public class SimianPresenceServiceConnector : IPresenceService, IGridUserService, ISharedRegionModule |
52 | { | 52 | { |
53 | private static readonly ILog m_log = | 53 | private static readonly ILog m_log = |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs index 6aefc38..bd8069f 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianProfiles.cs | |||
@@ -59,7 +59,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
59 | /// Connects avatar profile and classified queries to the SimianGrid | 59 | /// Connects avatar profile and classified queries to the SimianGrid |
60 | /// backend | 60 | /// backend |
61 | /// </summary> | 61 | /// </summary> |
62 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 62 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "SimianProfiles")] |
63 | public class SimianProfiles : INonSharedRegionModule | 63 | public class SimianProfiles : INonSharedRegionModule |
64 | { | 64 | { |
65 | private static readonly ILog m_log = | 65 | private static readonly ILog m_log = |
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs index 4350749..6e32b3a 100644 --- a/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs +++ b/OpenSim/Services/Connectors/SimianGrid/SimianUserAccountServiceConnector.cs | |||
@@ -45,7 +45,7 @@ namespace OpenSim.Services.Connectors.SimianGrid | |||
45 | /// Connects user account data (creating new users, looking up existing | 45 | /// Connects user account data (creating new users, looking up existing |
46 | /// users) to the SimianGrid backend | 46 | /// users) to the SimianGrid backend |
47 | /// </summary> | 47 | /// </summary> |
48 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] | 48 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "SimianUserAccountServiceConnector")] |
49 | public class SimianUserAccountServiceConnector : IUserAccountService, ISharedRegionModule | 49 | public class SimianUserAccountServiceConnector : IUserAccountService, ISharedRegionModule |
50 | { | 50 | { |
51 | private const double CACHE_EXPIRATION_SECONDS = 120.0; | 51 | private const double CACHE_EXPIRATION_SECONDS = 120.0; |
diff --git a/OpenSim/Services/FreeswitchService/Properties/AssemblyInfo.cs b/OpenSim/Services/FreeswitchService/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..58c7283 --- /dev/null +++ b/OpenSim/Services/FreeswitchService/Properties/AssemblyInfo.cs | |||
@@ -0,0 +1,33 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("OpenSim.Services.FreeswitchService")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("http://opensimulator.org")] | ||
12 | [assembly: AssemblyProduct("OpenSim")] | ||
13 | [assembly: AssemblyCopyright("OpenSimulator developers")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("af7d2401-cfd9-4ba5-8d6c-8af629984123")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | [assembly: AssemblyVersion("0.7.5.*")] | ||
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | ||
diff --git a/OpenSim/Services/Friends/Properties/AssemblyInfo.cs b/OpenSim/Services/Friends/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..dddb091 --- /dev/null +++ b/OpenSim/Services/Friends/Properties/AssemblyInfo.cs | |||
@@ -0,0 +1,33 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("OpenSim.Services.FriendsService")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("http://opensimulator.org")] | ||
12 | [assembly: AssemblyProduct("OpenSim")] | ||
13 | [assembly: AssemblyCopyright("OpenSimulator developers")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("a265d071-e152-42cc-9674-3ddd053977f5")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | [assembly: AssemblyVersion("0.7.5.*")] | ||
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | ||
diff --git a/OpenSim/Services/GridService/Properties/AssemblyInfo.cs b/OpenSim/Services/GridService/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..5c0c8f4 --- /dev/null +++ b/OpenSim/Services/GridService/Properties/AssemblyInfo.cs | |||
@@ -0,0 +1,33 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("OpenSim.Services.GridService")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("http://opensimulator.org")] | ||
12 | [assembly: AssemblyProduct("OpenSim")] | ||
13 | [assembly: AssemblyCopyright("OpenSimulator developers")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("96526d7b-4943-4b8e-9f0f-5908af621090")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | [assembly: AssemblyVersion("0.7.5.*")] | ||
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | ||
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index 004311f..7b84d55 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs | |||
@@ -68,6 +68,7 @@ namespace OpenSim.Services.HypergridService | |||
68 | private static UUID m_ScopeID; | 68 | private static UUID m_ScopeID; |
69 | private static bool m_AllowTeleportsToAnyRegion; | 69 | private static bool m_AllowTeleportsToAnyRegion; |
70 | private static string m_ExternalName; | 70 | private static string m_ExternalName; |
71 | private static Uri m_Uri; | ||
71 | private static GridRegion m_DefaultGatewayRegion; | 72 | private static GridRegion m_DefaultGatewayRegion; |
72 | 73 | ||
73 | public GatekeeperService(IConfigSource config, ISimulationService simService) | 74 | public GatekeeperService(IConfigSource config, ISimulationService simService) |
@@ -99,6 +100,15 @@ namespace OpenSim.Services.HypergridService | |||
99 | if (m_ExternalName != string.Empty && !m_ExternalName.EndsWith("/")) | 100 | if (m_ExternalName != string.Empty && !m_ExternalName.EndsWith("/")) |
100 | m_ExternalName = m_ExternalName + "/"; | 101 | m_ExternalName = m_ExternalName + "/"; |
101 | 102 | ||
103 | try | ||
104 | { | ||
105 | m_Uri = new Uri(m_ExternalName); | ||
106 | } | ||
107 | catch | ||
108 | { | ||
109 | m_log.WarnFormat("[GATEKEEPER SERVICE]: Malformed gatekeeper address {0}", m_ExternalName); | ||
110 | } | ||
111 | |||
102 | Object[] args = new Object[] { config }; | 112 | Object[] args = new Object[] { config }; |
103 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); | 113 | m_GridService = ServerUtils.LoadPlugin<IGridService>(gridService, args); |
104 | m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args); | 114 | m_PresenceService = ServerUtils.LoadPlugin<IPresenceService>(presenceService, args); |
@@ -433,7 +443,18 @@ namespace OpenSim.Services.HypergridService | |||
433 | string externalname = m_ExternalName.TrimEnd(trailing_slash); | 443 | string externalname = m_ExternalName.TrimEnd(trailing_slash); |
434 | m_log.DebugFormat("[GATEKEEPER SERVICE]: Verifying {0} against {1}", addressee, externalname); | 444 | m_log.DebugFormat("[GATEKEEPER SERVICE]: Verifying {0} against {1}", addressee, externalname); |
435 | 445 | ||
436 | return string.Equals(addressee, externalname, StringComparison.OrdinalIgnoreCase); | 446 | Uri uri; |
447 | try | ||
448 | { | ||
449 | uri = new Uri(addressee); | ||
450 | } | ||
451 | catch | ||
452 | { | ||
453 | m_log.DebugFormat("[GATEKEEPER SERVICE]: Visitor provided malformed service address {0}", addressee); | ||
454 | return false; | ||
455 | } | ||
456 | |||
457 | return string.Equals(uri.GetLeftPart(UriPartial.Authority), m_Uri.GetLeftPart(UriPartial.Authority), StringComparison.OrdinalIgnoreCase) ; | ||
437 | } | 458 | } |
438 | 459 | ||
439 | #endregion | 460 | #endregion |
diff --git a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs index 556a0da..784f136 100644 --- a/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs +++ b/OpenSim/Services/HypergridService/HGSuitcaseInventoryService.cs | |||
@@ -71,7 +71,7 @@ namespace OpenSim.Services.HypergridService | |||
71 | m_ConfigName = configName; | 71 | m_ConfigName = configName; |
72 | 72 | ||
73 | if (m_Database == null) | 73 | if (m_Database == null) |
74 | m_log.WarnFormat("[XXX]: m_Database is null!"); | 74 | m_log.ErrorFormat("[HG SUITCASE INVENTORY SERVICE]: m_Database is null!"); |
75 | 75 | ||
76 | // | 76 | // |
77 | // Try reading the [InventoryService] section, if it exists | 77 | // Try reading the [InventoryService] section, if it exists |
@@ -301,7 +301,7 @@ namespace OpenSim.Services.HypergridService | |||
301 | 301 | ||
302 | public override bool AddFolder(InventoryFolderBase folder) | 302 | public override bool AddFolder(InventoryFolderBase folder) |
303 | { | 303 | { |
304 | m_log.WarnFormat("[HG SUITCASE INVENTORY SERVICE]: AddFolder {0} {1}", folder.Name, folder.ParentID); | 304 | //m_log.WarnFormat("[HG SUITCASE INVENTORY SERVICE]: AddFolder {0} {1}", folder.Name, folder.ParentID); |
305 | // Let's do a bit of sanity checking, more than the base service does | 305 | // Let's do a bit of sanity checking, more than the base service does |
306 | // make sure the given folder's parent folder exists under the suitcase tree of this user | 306 | // make sure the given folder's parent folder exists under the suitcase tree of this user |
307 | 307 | ||
@@ -323,7 +323,7 @@ namespace OpenSim.Services.HypergridService | |||
323 | 323 | ||
324 | public override bool UpdateFolder(InventoryFolderBase folder) | 324 | public override bool UpdateFolder(InventoryFolderBase folder) |
325 | { | 325 | { |
326 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Update folder {0}, version {1}", folder.ID, folder.Version); | 326 | //m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: Update folder {0}, version {1}", folder.ID, folder.Version); |
327 | if (!IsWithinSuitcaseTree(folder.Owner, folder.ID)) | 327 | if (!IsWithinSuitcaseTree(folder.Owner, folder.ID)) |
328 | { | 328 | { |
329 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: folder {0} not within Suitcase tree", folder.Name); | 329 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: folder {0} not within Suitcase tree", folder.Name); |
@@ -460,6 +460,15 @@ namespace OpenSim.Services.HypergridService | |||
460 | 460 | ||
461 | if (folders != null && folders.Length > 0) | 461 | if (folders != null && folders.Length > 0) |
462 | return folders[0]; | 462 | return folders[0]; |
463 | |||
464 | // OK, so the RootFolder type didn't work. Let's look for any type with parent UUID.Zero. | ||
465 | folders = m_Database.GetFolders( | ||
466 | new string[] { "agentID", "folderName", "parentFolderID" }, | ||
467 | new string[] { principalID.ToString(), "My Inventory", UUID.Zero.ToString() }); | ||
468 | |||
469 | if (folders != null && folders.Length > 0) | ||
470 | return folders[0]; | ||
471 | |||
463 | return null; | 472 | return null; |
464 | } | 473 | } |
465 | 474 | ||
@@ -584,7 +593,7 @@ namespace OpenSim.Services.HypergridService | |||
584 | { | 593 | { |
585 | if (a.Wearables[i][j].ItemID == itemID) | 594 | if (a.Wearables[i][j].ItemID == itemID) |
586 | { | 595 | { |
587 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: item {0} is a wearable", itemID); | 596 | //m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: item {0} is a wearable", itemID); |
588 | return true; | 597 | return true; |
589 | } | 598 | } |
590 | } | 599 | } |
@@ -593,7 +602,7 @@ namespace OpenSim.Services.HypergridService | |||
593 | // Check attachments | 602 | // Check attachments |
594 | if (a.GetAttachmentForItem(itemID) != null) | 603 | if (a.GetAttachmentForItem(itemID) != null) |
595 | { | 604 | { |
596 | m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: item {0} is an attachment", itemID); | 605 | //m_log.DebugFormat("[HG SUITCASE INVENTORY SERVICE]: item {0} is an attachment", itemID); |
597 | return true; | 606 | return true; |
598 | } | 607 | } |
599 | 608 | ||
diff --git a/OpenSim/Services/HypergridService/Properties/AssemblyInfo.cs b/OpenSim/Services/HypergridService/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..49f2176 --- /dev/null +++ b/OpenSim/Services/HypergridService/Properties/AssemblyInfo.cs | |||
@@ -0,0 +1,33 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("OpenSim.Services.HypergridService")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("http://opensimulator.org")] | ||
12 | [assembly: AssemblyProduct("OpenSim")] | ||
13 | [assembly: AssemblyCopyright("OpenSimulator developers")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("8584f3c1-26dd-4d95-86f4-cd8f0110a18f")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | [assembly: AssemblyVersion("0.7.5.*")] | ||
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | ||
diff --git a/OpenSim/Services/Interfaces/IAssetService.cs b/OpenSim/Services/Interfaces/IAssetService.cs index 80494f1..3c469c6 100644 --- a/OpenSim/Services/Interfaces/IAssetService.cs +++ b/OpenSim/Services/Interfaces/IAssetService.cs | |||
@@ -68,7 +68,11 @@ namespace OpenSim.Services.Interfaces | |||
68 | /// </summary> | 68 | /// </summary> |
69 | /// <param name="id">The asset id</param> | 69 | /// <param name="id">The asset id</param> |
70 | /// <param name="sender">Represents the requester. Passed back via the handler</param> | 70 | /// <param name="sender">Represents the requester. Passed back via the handler</param> |
71 | /// <param name="handler">The handler to call back once the asset has been retrieved</param> | 71 | /// <param name="handler"> |
72 | /// The handler to call back once the asset has been retrieved. This will be called back with a null AssetBase | ||
73 | /// if the asset could not be found for some reason (e.g. if it does not exist, if a remote asset service | ||
74 | /// was not contactable, if it is not in the database, etc.). | ||
75 | /// </param> | ||
72 | /// <returns>True if the id was parseable, false otherwise</returns> | 76 | /// <returns>True if the id was parseable, false otherwise</returns> |
73 | bool Get(string id, Object sender, AssetRetrieved handler); | 77 | bool Get(string id, Object sender, AssetRetrieved handler); |
74 | 78 | ||
diff --git a/OpenSim/Services/Interfaces/Properties/AssemblyInfo.cs b/OpenSim/Services/Interfaces/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..4723553 --- /dev/null +++ b/OpenSim/Services/Interfaces/Properties/AssemblyInfo.cs | |||
@@ -0,0 +1,33 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("OpenSim.Services.Interfaces")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("http://opensimulator.org")] | ||
12 | [assembly: AssemblyProduct("OpenSim")] | ||
13 | [assembly: AssemblyCopyright("OpenSimulator developers")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("39091de1-1c4c-4ebe-bb01-31551ec1749d")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | [assembly: AssemblyVersion("0.7.5.*")] | ||
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | ||
diff --git a/OpenSim/Services/InventoryService/InventoryService.cs b/OpenSim/Services/InventoryService/InventoryService.cs deleted file mode 100644 index 73dd06a..0000000 --- a/OpenSim/Services/InventoryService/InventoryService.cs +++ /dev/null | |||
@@ -1,700 +0,0 @@ | |||
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 Nini.Config; | ||
33 | using OpenMetaverse; | ||
34 | using OpenSim.Data; | ||
35 | using OpenSim.Framework; | ||
36 | using OpenSim.Services.Interfaces; | ||
37 | |||
38 | namespace OpenSim.Services.InventoryService | ||
39 | { | ||
40 | /// <summary> | ||
41 | /// The Inventory service reference implementation | ||
42 | /// </summary> | ||
43 | public class InventoryService : InventoryServiceBase, IInventoryService | ||
44 | { | ||
45 | private static readonly ILog m_log | ||
46 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | ||
47 | |||
48 | public InventoryService(IConfigSource config) : base(config) | ||
49 | { | ||
50 | m_log.Debug("[INVENTORY SERVICE]: Initialized."); | ||
51 | } | ||
52 | |||
53 | #region IInventoryServices methods | ||
54 | |||
55 | public string Host | ||
56 | { | ||
57 | get { return "default"; } | ||
58 | } | ||
59 | |||
60 | public List<InventoryFolderBase> GetInventorySkeleton(UUID userId) | ||
61 | { | ||
62 | m_log.DebugFormat("[INVENTORY SERVICE]: Getting inventory skeleton for {0}", userId); | ||
63 | |||
64 | InventoryFolderBase rootFolder = GetRootFolder(userId); | ||
65 | |||
66 | // Agent has no inventory structure yet. | ||
67 | if (null == rootFolder) | ||
68 | { | ||
69 | m_log.DebugFormat("[INVENTORY SERVICE]: No root folder"); | ||
70 | return null; | ||
71 | } | ||
72 | |||
73 | List<InventoryFolderBase> userFolders = new List<InventoryFolderBase>(); | ||
74 | |||
75 | userFolders.Add(rootFolder); | ||
76 | |||
77 | IList<InventoryFolderBase> folders = m_Database.getFolderHierarchy(rootFolder.ID); | ||
78 | userFolders.AddRange(folders); | ||
79 | |||
80 | // m_log.DebugFormat("[INVENTORY SERVICE]: Got folder {0} {1}", folder.name, folder.folderID); | ||
81 | |||
82 | return userFolders; | ||
83 | } | ||
84 | |||
85 | public virtual bool HasInventoryForUser(UUID userID) | ||
86 | { | ||
87 | return false; | ||
88 | } | ||
89 | |||
90 | // See IInventoryServices | ||
91 | public virtual InventoryFolderBase GetRootFolder(UUID userID) | ||
92 | { | ||
93 | //m_log.DebugFormat("[INVENTORY SERVICE]: Getting root folder for {0}", userID); | ||
94 | |||
95 | // Retrieve the first root folder we get from the DB. | ||
96 | InventoryFolderBase rootFolder = m_Database.getUserRootFolder(userID); | ||
97 | if (rootFolder != null) | ||
98 | return rootFolder; | ||
99 | |||
100 | // Return nothing if the plugin was unable to supply a root folder | ||
101 | return null; | ||
102 | } | ||
103 | |||
104 | // See IInventoryServices | ||
105 | public bool CreateUserInventory(UUID user) | ||
106 | { | ||
107 | InventoryFolderBase existingRootFolder; | ||
108 | try | ||
109 | { | ||
110 | existingRootFolder = GetRootFolder(user); | ||
111 | } | ||
112 | catch /*(Exception e)*/ | ||
113 | { | ||
114 | // Munch the exception, it has already been reported | ||
115 | // | ||
116 | return false; | ||
117 | } | ||
118 | |||
119 | if (null != existingRootFolder) | ||
120 | { | ||
121 | m_log.WarnFormat( | ||
122 | "[INVENTORY SERVICE]: Did not create a new inventory for user {0} since they already have " | ||
123 | + "a root inventory folder with id {1}", | ||
124 | user, existingRootFolder.ID); | ||
125 | } | ||
126 | else | ||
127 | { | ||
128 | UsersInventory inven = new UsersInventory(); | ||
129 | inven.CreateNewInventorySet(user); | ||
130 | AddNewInventorySet(inven); | ||
131 | |||
132 | return true; | ||
133 | } | ||
134 | |||
135 | return false; | ||
136 | } | ||
137 | |||
138 | // See IInventoryServices | ||
139 | |||
140 | /// <summary> | ||
141 | /// Return a user's entire inventory synchronously | ||
142 | /// </summary> | ||
143 | /// <param name="rawUserID"></param> | ||
144 | /// <returns>The user's inventory. If an inventory cannot be found then an empty collection is returned.</returns> | ||
145 | public InventoryCollection GetUserInventory(UUID userID) | ||
146 | { | ||
147 | m_log.InfoFormat("[INVENTORY SERVICE]: Processing request for inventory of {0}", userID); | ||
148 | |||
149 | // Uncomment me to simulate a slow responding inventory server | ||
150 | //Thread.Sleep(16000); | ||
151 | |||
152 | InventoryCollection invCollection = new InventoryCollection(); | ||
153 | |||
154 | List<InventoryFolderBase> allFolders = GetInventorySkeleton(userID); | ||
155 | |||
156 | if (null == allFolders) | ||
157 | { | ||
158 | m_log.WarnFormat("[INVENTORY SERVICE]: No inventory found for user {0}", userID); | ||
159 | |||
160 | return invCollection; | ||
161 | } | ||
162 | |||
163 | List<InventoryItemBase> allItems = new List<InventoryItemBase>(); | ||
164 | |||
165 | foreach (InventoryFolderBase folder in allFolders) | ||
166 | { | ||
167 | List<InventoryItemBase> items = GetFolderItems(userID, folder.ID); | ||
168 | |||
169 | if (items != null) | ||
170 | { | ||
171 | allItems.InsertRange(0, items); | ||
172 | } | ||
173 | } | ||
174 | |||
175 | invCollection.UserID = userID; | ||
176 | invCollection.Folders = allFolders; | ||
177 | invCollection.Items = allItems; | ||
178 | |||
179 | // foreach (InventoryFolderBase folder in invCollection.Folders) | ||
180 | // { | ||
181 | // m_log.DebugFormat("[GRID INVENTORY SERVICE]: Sending back folder {0} {1}", folder.Name, folder.ID); | ||
182 | // } | ||
183 | // | ||
184 | // foreach (InventoryItemBase item in invCollection.Items) | ||
185 | // { | ||
186 | // m_log.DebugFormat("[GRID INVENTORY SERVICE]: Sending back item {0} {1}, folder {2}", item.Name, item.ID, item.Folder); | ||
187 | // } | ||
188 | |||
189 | m_log.InfoFormat( | ||
190 | "[INVENTORY SERVICE]: Sending back inventory response to user {0} containing {1} folders and {2} items", | ||
191 | invCollection.UserID, invCollection.Folders.Count, invCollection.Items.Count); | ||
192 | |||
193 | return invCollection; | ||
194 | } | ||
195 | |||
196 | /// <summary> | ||
197 | /// Asynchronous inventory fetch. | ||
198 | /// </summary> | ||
199 | /// <param name="userID"></param> | ||
200 | /// <param name="callback"></param> | ||
201 | public void GetUserInventory(UUID userID, InventoryReceiptCallback callback) | ||
202 | { | ||
203 | m_log.InfoFormat("[INVENTORY SERVICE]: Requesting inventory for user {0}", userID); | ||
204 | |||
205 | List<InventoryFolderImpl> folders = new List<InventoryFolderImpl>(); | ||
206 | List<InventoryItemBase> items = new List<InventoryItemBase>(); | ||
207 | |||
208 | List<InventoryFolderBase> skeletonFolders = GetInventorySkeleton(userID); | ||
209 | |||
210 | if (skeletonFolders != null) | ||
211 | { | ||
212 | InventoryFolderImpl rootFolder = null; | ||
213 | |||
214 | // Need to retrieve the root folder on the first pass | ||
215 | foreach (InventoryFolderBase folder in skeletonFolders) | ||
216 | { | ||
217 | if (folder.ParentID == UUID.Zero) | ||
218 | { | ||
219 | rootFolder = new InventoryFolderImpl(folder); | ||
220 | folders.Add(rootFolder); | ||
221 | items.AddRange(GetFolderItems(userID, rootFolder.ID)); | ||
222 | break; // Only 1 root folder per user | ||
223 | } | ||
224 | } | ||
225 | |||
226 | if (rootFolder != null) | ||
227 | { | ||
228 | foreach (InventoryFolderBase folder in skeletonFolders) | ||
229 | { | ||
230 | if (folder.ID != rootFolder.ID) | ||
231 | { | ||
232 | folders.Add(new InventoryFolderImpl(folder)); | ||
233 | items.AddRange(GetFolderItems(userID, folder.ID)); | ||
234 | } | ||
235 | } | ||
236 | } | ||
237 | |||
238 | m_log.InfoFormat( | ||
239 | "[INVENTORY SERVICE]: Received inventory response for user {0} containing {1} folders and {2} items", | ||
240 | userID, folders.Count, items.Count); | ||
241 | } | ||
242 | else | ||
243 | { | ||
244 | m_log.WarnFormat("[INVENTORY SERVICE]: User {0} inventory not available", userID); | ||
245 | } | ||
246 | |||
247 | Util.FireAndForget(delegate { callback(folders, items); }); | ||
248 | } | ||
249 | |||
250 | public InventoryCollection GetFolderContent(UUID userID, UUID folderID) | ||
251 | { | ||
252 | // Uncomment me to simulate a slow responding inventory server | ||
253 | //Thread.Sleep(16000); | ||
254 | |||
255 | InventoryCollection invCollection = new InventoryCollection(); | ||
256 | |||
257 | List<InventoryItemBase> items = GetFolderItems(userID, folderID); | ||
258 | List<InventoryFolderBase> folders = RequestSubFolders(folderID); | ||
259 | |||
260 | invCollection.UserID = userID; | ||
261 | invCollection.Folders = folders; | ||
262 | invCollection.Items = items; | ||
263 | |||
264 | m_log.DebugFormat("[INVENTORY SERVICE]: Found {0} items and {1} folders in folder {2}", items.Count, folders.Count, folderID); | ||
265 | |||
266 | return invCollection; | ||
267 | } | ||
268 | |||
269 | public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) | ||
270 | { | ||
271 | // m_log.DebugFormat("[INVENTORY SERVICE]: Looking for folder type {0} for user {1}", type, userID); | ||
272 | |||
273 | InventoryFolderBase root = m_Database.getUserRootFolder(userID); | ||
274 | if (root != null) | ||
275 | { | ||
276 | List<InventoryFolderBase> folders = RequestSubFolders(root.ID); | ||
277 | |||
278 | foreach (InventoryFolderBase folder in folders) | ||
279 | { | ||
280 | if (folder.Type == (short)type) | ||
281 | { | ||
282 | // m_log.DebugFormat( | ||
283 | // "[INVENTORY SERVICE]: Found folder {0} type {1}", folder.Name, (AssetType)folder.Type); | ||
284 | |||
285 | return folder; | ||
286 | } | ||
287 | } | ||
288 | } | ||
289 | |||
290 | // we didn't find any folder of that type. Return the root folder | ||
291 | // hopefully the root folder is not null. If it is, too bad | ||
292 | return root; | ||
293 | } | ||
294 | |||
295 | public Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID) | ||
296 | { | ||
297 | InventoryFolderBase root = GetRootFolder(userID); | ||
298 | if (root != null) | ||
299 | { | ||
300 | InventoryCollection content = GetFolderContent(userID, root.ID); | ||
301 | if (content != null) | ||
302 | { | ||
303 | Dictionary<AssetType, InventoryFolderBase> folders = new Dictionary<AssetType, InventoryFolderBase>(); | ||
304 | foreach (InventoryFolderBase folder in content.Folders) | ||
305 | { | ||
306 | if ((folder.Type != (short)AssetType.Folder) && (folder.Type != (short)AssetType.Unknown)) | ||
307 | folders[(AssetType)folder.Type] = folder; | ||
308 | } | ||
309 | m_log.DebugFormat("[INVENTORY SERVICE]: Got {0} system folders for {1}", folders.Count, userID); | ||
310 | return folders; | ||
311 | } | ||
312 | } | ||
313 | m_log.WarnFormat("[INVENTORY SERVICE]: System folders for {0} not found", userID); | ||
314 | return new Dictionary<AssetType, InventoryFolderBase>(); | ||
315 | } | ||
316 | |||
317 | public List<InventoryItemBase> GetActiveGestures(UUID userId) | ||
318 | { | ||
319 | List<InventoryItemBase> activeGestures = new List<InventoryItemBase>(); | ||
320 | activeGestures.AddRange(m_Database.fetchActiveGestures(userId)); | ||
321 | |||
322 | return activeGestures; | ||
323 | } | ||
324 | |||
325 | #endregion | ||
326 | |||
327 | #region Methods used by GridInventoryService | ||
328 | |||
329 | public List<InventoryFolderBase> RequestSubFolders(UUID parentFolderID) | ||
330 | { | ||
331 | List<InventoryFolderBase> inventoryList = new List<InventoryFolderBase>(); | ||
332 | |||
333 | inventoryList.AddRange(m_Database.getInventoryFolders(parentFolderID)); | ||
334 | |||
335 | return inventoryList; | ||
336 | } | ||
337 | |||
338 | public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) | ||
339 | { | ||
340 | List<InventoryItemBase> itemsList = new List<InventoryItemBase>(); | ||
341 | |||
342 | itemsList.AddRange(m_Database.getInventoryInFolder(folderID)); | ||
343 | |||
344 | // m_log.DebugFormat( | ||
345 | // "[INVENTORY SERVICE]: Found {0} items in folder {1} for {2}", itemsList.Count, folderID, userID); | ||
346 | |||
347 | return itemsList; | ||
348 | } | ||
349 | |||
350 | #endregion | ||
351 | |||
352 | // See IInventoryServices | ||
353 | public virtual bool AddFolder(InventoryFolderBase folder) | ||
354 | { | ||
355 | m_log.DebugFormat( | ||
356 | "[INVENTORY SERVICE]: Adding folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); | ||
357 | |||
358 | m_Database.addInventoryFolder(folder); | ||
359 | |||
360 | // FIXME: Should return false on failure | ||
361 | return true; | ||
362 | } | ||
363 | |||
364 | // See IInventoryServices | ||
365 | public virtual bool UpdateFolder(InventoryFolderBase folder) | ||
366 | { | ||
367 | m_log.DebugFormat( | ||
368 | "[INVENTORY SERVICE]: Updating folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); | ||
369 | |||
370 | m_Database.updateInventoryFolder(folder); | ||
371 | |||
372 | // FIXME: Should return false on failure | ||
373 | return true; | ||
374 | } | ||
375 | |||
376 | // See IInventoryServices | ||
377 | public virtual bool MoveFolder(InventoryFolderBase folder) | ||
378 | { | ||
379 | m_log.DebugFormat( | ||
380 | "[INVENTORY SERVICE]: Moving folder {0} {1} to folder {2}", folder.Name, folder.ID, folder.ParentID); | ||
381 | |||
382 | m_Database.moveInventoryFolder(folder); | ||
383 | |||
384 | // FIXME: Should return false on failure | ||
385 | return true; | ||
386 | } | ||
387 | |||
388 | // See IInventoryServices | ||
389 | public virtual bool AddItem(InventoryItemBase item) | ||
390 | { | ||
391 | // m_log.DebugFormat( | ||
392 | // "[INVENTORY SERVICE]: Adding item {0} {1} to folder {2} for {3}", | ||
393 | // item.Name, item.ID, item.Folder, item.Owner); | ||
394 | |||
395 | m_Database.addInventoryItem(item); | ||
396 | |||
397 | // FIXME: Should return false on failure | ||
398 | return true; | ||
399 | } | ||
400 | |||
401 | // See IInventoryServices | ||
402 | public virtual bool UpdateItem(InventoryItemBase item) | ||
403 | { | ||
404 | m_log.InfoFormat( | ||
405 | "[INVENTORY SERVICE]: Updating item {0} {1} in folder {2}", item.Name, item.ID, item.Folder); | ||
406 | |||
407 | m_Database.updateInventoryItem(item); | ||
408 | |||
409 | // FIXME: Should return false on failure | ||
410 | return true; | ||
411 | } | ||
412 | |||
413 | public virtual bool MoveItems(UUID ownerID, List<InventoryItemBase> items) | ||
414 | { | ||
415 | m_log.InfoFormat( | ||
416 | "[INVENTORY SERVICE]: Moving {0} items from user {1}", items.Count, ownerID); | ||
417 | |||
418 | InventoryItemBase itm = null; | ||
419 | foreach (InventoryItemBase item in items) | ||
420 | { | ||
421 | itm = GetInventoryItem(item.ID); | ||
422 | itm.Folder = item.Folder; | ||
423 | if ((item.Name != null) && !item.Name.Equals(string.Empty)) | ||
424 | itm.Name = item.Name; | ||
425 | m_Database.updateInventoryItem(itm); | ||
426 | } | ||
427 | |||
428 | return true; | ||
429 | } | ||
430 | |||
431 | // See IInventoryServices | ||
432 | public virtual bool DeleteItems(UUID owner, List<UUID> itemIDs) | ||
433 | { | ||
434 | m_log.InfoFormat( | ||
435 | "[INVENTORY SERVICE]: Deleting {0} items from user {1}", itemIDs.Count, owner); | ||
436 | |||
437 | // uhh..... | ||
438 | foreach (UUID uuid in itemIDs) | ||
439 | m_Database.deleteInventoryItem(uuid); | ||
440 | |||
441 | // FIXME: Should return false on failure | ||
442 | return true; | ||
443 | } | ||
444 | |||
445 | public virtual InventoryItemBase GetItem(InventoryItemBase item) | ||
446 | { | ||
447 | InventoryItemBase result = m_Database.getInventoryItem(item.ID); | ||
448 | if (result != null) | ||
449 | return result; | ||
450 | m_log.DebugFormat("[INVENTORY SERVICE]: GetItem failed to find item {0}", item.ID); | ||
451 | return null; | ||
452 | } | ||
453 | |||
454 | public virtual InventoryFolderBase GetFolder(InventoryFolderBase folder) | ||
455 | { | ||
456 | InventoryFolderBase result = m_Database.getInventoryFolder(folder.ID); | ||
457 | if (result != null) | ||
458 | return result; | ||
459 | |||
460 | m_log.DebugFormat("[INVENTORY SERVICE]: GetFolder failed to find folder {0}", folder.ID); | ||
461 | return null; | ||
462 | } | ||
463 | |||
464 | public virtual bool DeleteFolders(UUID ownerID, List<UUID> folderIDs) | ||
465 | { | ||
466 | m_log.InfoFormat("[INVENTORY SERVICE]: Deleting {0} folders from user {1}", folderIDs.Count, ownerID); | ||
467 | foreach (UUID id in folderIDs) | ||
468 | { | ||
469 | InventoryFolderBase folder = new InventoryFolderBase(id, ownerID); | ||
470 | PurgeFolder(folder); | ||
471 | m_Database.deleteInventoryFolder(id); | ||
472 | } | ||
473 | return true; | ||
474 | } | ||
475 | |||
476 | /// <summary> | ||
477 | /// Purge a folder of all items items and subfolders. | ||
478 | /// | ||
479 | /// FIXME: Really nasty in a sense, because we have to query the database to get information we may | ||
480 | /// already know... Needs heavy refactoring. | ||
481 | /// </summary> | ||
482 | /// <param name="folder"></param> | ||
483 | public virtual bool PurgeFolder(InventoryFolderBase folder) | ||
484 | { | ||
485 | m_log.DebugFormat( | ||
486 | "[INVENTORY SERVICE]: Purging folder {0} {1} of its contents", folder.Name, folder.ID); | ||
487 | |||
488 | List<InventoryFolderBase> subFolders = RequestSubFolders(folder.ID); | ||
489 | |||
490 | foreach (InventoryFolderBase subFolder in subFolders) | ||
491 | { | ||
492 | // m_log.DebugFormat("[INVENTORY SERVICE]: Deleting folder {0} {1}", subFolder.Name, subFolder.ID); | ||
493 | |||
494 | m_Database.deleteInventoryFolder(subFolder.ID); | ||
495 | } | ||
496 | |||
497 | List<InventoryItemBase> items = GetFolderItems(folder.Owner, folder.ID); | ||
498 | |||
499 | List<UUID> uuids = new List<UUID>(); | ||
500 | foreach (InventoryItemBase item in items) | ||
501 | { | ||
502 | uuids.Add(item.ID); | ||
503 | } | ||
504 | DeleteItems(folder.Owner, uuids); | ||
505 | |||
506 | // FIXME: Should return false on failure | ||
507 | return true; | ||
508 | } | ||
509 | |||
510 | private void AddNewInventorySet(UsersInventory inventory) | ||
511 | { | ||
512 | foreach (InventoryFolderBase folder in inventory.Folders.Values) | ||
513 | { | ||
514 | AddFolder(folder); | ||
515 | } | ||
516 | } | ||
517 | |||
518 | public InventoryItemBase GetInventoryItem(UUID itemID) | ||
519 | { | ||
520 | InventoryItemBase item = m_Database.getInventoryItem(itemID); | ||
521 | if (item != null) | ||
522 | return item; | ||
523 | |||
524 | return null; | ||
525 | } | ||
526 | |||
527 | public int GetAssetPermissions(UUID userID, UUID assetID) | ||
528 | { | ||
529 | InventoryFolderBase parent = GetRootFolder(userID); | ||
530 | return FindAssetPerms(parent, assetID); | ||
531 | } | ||
532 | |||
533 | private int FindAssetPerms(InventoryFolderBase folder, UUID assetID) | ||
534 | { | ||
535 | InventoryCollection contents = GetFolderContent(folder.Owner, folder.ID); | ||
536 | |||
537 | int perms = 0; | ||
538 | foreach (InventoryItemBase item in contents.Items) | ||
539 | { | ||
540 | if (item.AssetID == assetID) | ||
541 | perms = (int)item.CurrentPermissions | perms; | ||
542 | } | ||
543 | |||
544 | foreach (InventoryFolderBase subfolder in contents.Folders) | ||
545 | perms = perms | FindAssetPerms(subfolder, assetID); | ||
546 | |||
547 | return perms; | ||
548 | } | ||
549 | |||
550 | /// <summary> | ||
551 | /// Used to create a new user inventory. | ||
552 | /// </summary> | ||
553 | private class UsersInventory | ||
554 | { | ||
555 | public Dictionary<UUID, InventoryFolderBase> Folders = new Dictionary<UUID, InventoryFolderBase>(); | ||
556 | public Dictionary<UUID, InventoryItemBase> Items = new Dictionary<UUID, InventoryItemBase>(); | ||
557 | |||
558 | public virtual void CreateNewInventorySet(UUID user) | ||
559 | { | ||
560 | InventoryFolderBase folder = new InventoryFolderBase(); | ||
561 | |||
562 | folder.ParentID = UUID.Zero; | ||
563 | folder.Owner = user; | ||
564 | folder.ID = UUID.Random(); | ||
565 | folder.Name = "My Inventory"; | ||
566 | folder.Type = (short)AssetType.Folder; | ||
567 | folder.Version = 1; | ||
568 | Folders.Add(folder.ID, folder); | ||
569 | |||
570 | UUID rootFolder = folder.ID; | ||
571 | |||
572 | folder = new InventoryFolderBase(); | ||
573 | folder.ParentID = rootFolder; | ||
574 | folder.Owner = user; | ||
575 | folder.ID = UUID.Random(); | ||
576 | folder.Name = "Animations"; | ||
577 | folder.Type = (short)AssetType.Animation; | ||
578 | folder.Version = 1; | ||
579 | Folders.Add(folder.ID, folder); | ||
580 | |||
581 | folder = new InventoryFolderBase(); | ||
582 | folder.ParentID = rootFolder; | ||
583 | folder.Owner = user; | ||
584 | folder.ID = UUID.Random(); | ||
585 | folder.Name = "Body Parts"; | ||
586 | folder.Type = (short)AssetType.Bodypart; | ||
587 | folder.Version = 1; | ||
588 | Folders.Add(folder.ID, folder); | ||
589 | |||
590 | folder = new InventoryFolderBase(); | ||
591 | folder.ParentID = rootFolder; | ||
592 | folder.Owner = user; | ||
593 | folder.ID = UUID.Random(); | ||
594 | folder.Name = "Calling Cards"; | ||
595 | folder.Type = (short)AssetType.CallingCard; | ||
596 | folder.Version = 1; | ||
597 | Folders.Add(folder.ID, folder); | ||
598 | |||
599 | folder = new InventoryFolderBase(); | ||
600 | folder.ParentID = rootFolder; | ||
601 | folder.Owner = user; | ||
602 | folder.ID = UUID.Random(); | ||
603 | folder.Name = "Clothing"; | ||
604 | folder.Type = (short)AssetType.Clothing; | ||
605 | folder.Version = 1; | ||
606 | Folders.Add(folder.ID, folder); | ||
607 | |||
608 | folder = new InventoryFolderBase(); | ||
609 | folder.ParentID = rootFolder; | ||
610 | folder.Owner = user; | ||
611 | folder.ID = UUID.Random(); | ||
612 | folder.Name = "Gestures"; | ||
613 | folder.Type = (short)AssetType.Gesture; | ||
614 | folder.Version = 1; | ||
615 | Folders.Add(folder.ID, folder); | ||
616 | |||
617 | folder = new InventoryFolderBase(); | ||
618 | folder.ParentID = rootFolder; | ||
619 | folder.Owner = user; | ||
620 | folder.ID = UUID.Random(); | ||
621 | folder.Name = "Landmarks"; | ||
622 | folder.Type = (short)AssetType.Landmark; | ||
623 | folder.Version = 1; | ||
624 | Folders.Add(folder.ID, folder); | ||
625 | |||
626 | folder = new InventoryFolderBase(); | ||
627 | folder.ParentID = rootFolder; | ||
628 | folder.Owner = user; | ||
629 | folder.ID = UUID.Random(); | ||
630 | folder.Name = "Lost And Found"; | ||
631 | folder.Type = (short)AssetType.LostAndFoundFolder; | ||
632 | folder.Version = 1; | ||
633 | Folders.Add(folder.ID, folder); | ||
634 | |||
635 | folder = new InventoryFolderBase(); | ||
636 | folder.ParentID = rootFolder; | ||
637 | folder.Owner = user; | ||
638 | folder.ID = UUID.Random(); | ||
639 | folder.Name = "Notecards"; | ||
640 | folder.Type = (short)AssetType.Notecard; | ||
641 | folder.Version = 1; | ||
642 | Folders.Add(folder.ID, folder); | ||
643 | |||
644 | folder = new InventoryFolderBase(); | ||
645 | folder.ParentID = rootFolder; | ||
646 | folder.Owner = user; | ||
647 | folder.ID = UUID.Random(); | ||
648 | folder.Name = "Objects"; | ||
649 | folder.Type = (short)AssetType.Object; | ||
650 | folder.Version = 1; | ||
651 | Folders.Add(folder.ID, folder); | ||
652 | |||
653 | folder = new InventoryFolderBase(); | ||
654 | folder.ParentID = rootFolder; | ||
655 | folder.Owner = user; | ||
656 | folder.ID = UUID.Random(); | ||
657 | folder.Name = "Photo Album"; | ||
658 | folder.Type = (short)AssetType.SnapshotFolder; | ||
659 | folder.Version = 1; | ||
660 | Folders.Add(folder.ID, folder); | ||
661 | |||
662 | folder = new InventoryFolderBase(); | ||
663 | folder.ParentID = rootFolder; | ||
664 | folder.Owner = user; | ||
665 | folder.ID = UUID.Random(); | ||
666 | folder.Name = "Scripts"; | ||
667 | folder.Type = (short)AssetType.LSLText; | ||
668 | folder.Version = 1; | ||
669 | Folders.Add(folder.ID, folder); | ||
670 | |||
671 | folder = new InventoryFolderBase(); | ||
672 | folder.ParentID = rootFolder; | ||
673 | folder.Owner = user; | ||
674 | folder.ID = UUID.Random(); | ||
675 | folder.Name = "Sounds"; | ||
676 | folder.Type = (short)AssetType.Sound; | ||
677 | folder.Version = 1; | ||
678 | Folders.Add(folder.ID, folder); | ||
679 | |||
680 | folder = new InventoryFolderBase(); | ||
681 | folder.ParentID = rootFolder; | ||
682 | folder.Owner = user; | ||
683 | folder.ID = UUID.Random(); | ||
684 | folder.Name = "Textures"; | ||
685 | folder.Type = (short)AssetType.Texture; | ||
686 | folder.Version = 1; | ||
687 | Folders.Add(folder.ID, folder); | ||
688 | |||
689 | folder = new InventoryFolderBase(); | ||
690 | folder.ParentID = rootFolder; | ||
691 | folder.Owner = user; | ||
692 | folder.ID = UUID.Random(); | ||
693 | folder.Name = "Trash"; | ||
694 | folder.Type = (short)AssetType.TrashFolder; | ||
695 | folder.Version = 1; | ||
696 | Folders.Add(folder.ID, folder); | ||
697 | } | ||
698 | } | ||
699 | } | ||
700 | } | ||
diff --git a/OpenSim/Services/InventoryService/InventoryServiceBase.cs b/OpenSim/Services/InventoryService/InventoryServiceBase.cs deleted file mode 100644 index 456e455..0000000 --- a/OpenSim/Services/InventoryService/InventoryServiceBase.cs +++ /dev/null | |||
@@ -1,82 +0,0 @@ | |||
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 Nini.Config; | ||
32 | using OpenSim.Framework; | ||
33 | using OpenSim.Data; | ||
34 | using OpenSim.Services.Interfaces; | ||
35 | using OpenSim.Services.Base; | ||
36 | |||
37 | namespace OpenSim.Services.InventoryService | ||
38 | { | ||
39 | public class InventoryServiceBase : ServiceBase | ||
40 | { | ||
41 | protected IInventoryDataPlugin m_Database = null; | ||
42 | |||
43 | public InventoryServiceBase(IConfigSource config) : base(config) | ||
44 | { | ||
45 | string dllName = String.Empty; | ||
46 | string connString = String.Empty; | ||
47 | |||
48 | // | ||
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 | } | ||
57 | |||
58 | // | ||
59 | // Try reading the more specific [InventoryService] section, if it exists | ||
60 | // | ||
61 | IConfig inventoryConfig = config.Configs["InventoryService"]; | ||
62 | if (inventoryConfig != null) | ||
63 | { | ||
64 | dllName = inventoryConfig.GetString("StorageProvider", dllName); | ||
65 | connString = inventoryConfig.GetString("ConnectionString", connString); | ||
66 | } | ||
67 | |||
68 | // | ||
69 | // We tried, but this doesn't exist. We can't proceed. | ||
70 | // | ||
71 | if (dllName.Equals(String.Empty)) | ||
72 | throw new Exception("No InventoryService configuration"); | ||
73 | |||
74 | m_Database = LoadPlugin<IInventoryDataPlugin>(dllName); | ||
75 | if (m_Database == null) | ||
76 | throw new Exception("Could not find a storage interface in the given module"); | ||
77 | |||
78 | m_Database.Initialise(connString); | ||
79 | } | ||
80 | |||
81 | } | ||
82 | } | ||
diff --git a/OpenSim/Services/InventoryService/Properties/AssemblyInfo.cs b/OpenSim/Services/InventoryService/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..41ad9f8 --- /dev/null +++ b/OpenSim/Services/InventoryService/Properties/AssemblyInfo.cs | |||
@@ -0,0 +1,33 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("OpenSim.Services.InventoryService")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("http://opensimulator.org")] | ||
12 | [assembly: AssemblyProduct("OpenSim")] | ||
13 | [assembly: AssemblyCopyright("OpenSimulator developers")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("d96d6d8c-9769-47e7-88dc-dbeb8fe7105a")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | [assembly: AssemblyVersion("0.7.5.*")] | ||
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | ||
diff --git a/OpenSim/Services/InventoryService/Tests/XInventoryServiceTests.cs b/OpenSim/Services/InventoryService/Tests/XInventoryServiceTests.cs new file mode 100644 index 0000000..9e3fa69 --- /dev/null +++ b/OpenSim/Services/InventoryService/Tests/XInventoryServiceTests.cs | |||
@@ -0,0 +1,177 @@ | |||
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 Nini.Config; | ||
30 | using NUnit.Framework; | ||
31 | using OpenMetaverse; | ||
32 | using OpenSim.Framework; | ||
33 | using OpenSim.Server.Base; | ||
34 | using OpenSim.Services.Interfaces; | ||
35 | using OpenSim.Tests.Common; | ||
36 | |||
37 | namespace OpenSim.Services.InventoryService.Tests | ||
38 | { | ||
39 | /// <summary> | ||
40 | /// Tests for the XInventoryService | ||
41 | /// </summary> | ||
42 | /// <remarks> | ||
43 | /// TODO: Fill out more tests. | ||
44 | /// </remarks> | ||
45 | [TestFixture] | ||
46 | public class XInventoryServiceTests : OpenSimTestCase | ||
47 | { | ||
48 | private IInventoryService CreateXInventoryService() | ||
49 | { | ||
50 | IConfigSource config = new IniConfigSource(); | ||
51 | config.AddConfig("InventoryService"); | ||
52 | config.Configs["InventoryService"].Set("StorageProvider", "OpenSim.Tests.Common.dll"); | ||
53 | |||
54 | return ServerUtils.LoadPlugin<IInventoryService>( | ||
55 | "OpenSim.Services.InventoryService.dll:XInventoryService", new Object[] { config }); | ||
56 | } | ||
57 | |||
58 | /// <summary> | ||
59 | /// Tests add item operation. | ||
60 | /// </summary> | ||
61 | /// <remarks> | ||
62 | /// TODO: Test all operations. | ||
63 | /// </remarks> | ||
64 | [Test] | ||
65 | public void TestAddItem() | ||
66 | { | ||
67 | TestHelpers.InMethod(); | ||
68 | |||
69 | string creatorId = TestHelpers.ParseTail(0x1).ToString(); | ||
70 | UUID ownerId = TestHelpers.ParseTail(0x2); | ||
71 | UUID itemId = TestHelpers.ParseTail(0x10); | ||
72 | UUID assetId = TestHelpers.ParseTail(0x20); | ||
73 | UUID folderId = TestHelpers.ParseTail(0x30); | ||
74 | int invType = (int)InventoryType.Animation; | ||
75 | int assetType = (int)AssetType.Animation; | ||
76 | string itemName = "item1"; | ||
77 | |||
78 | IInventoryService xis = CreateXInventoryService(); | ||
79 | |||
80 | InventoryItemBase itemToStore | ||
81 | = new InventoryItemBase(itemId, ownerId) | ||
82 | { | ||
83 | CreatorIdentification = creatorId.ToString(), | ||
84 | AssetID = assetId, | ||
85 | Name = itemName, | ||
86 | Folder = folderId, | ||
87 | InvType = invType, | ||
88 | AssetType = assetType | ||
89 | }; | ||
90 | |||
91 | Assert.That(xis.AddItem(itemToStore), Is.True); | ||
92 | |||
93 | InventoryItemBase itemRetrieved = new InventoryItemBase(itemId); | ||
94 | itemRetrieved = xis.GetItem(itemRetrieved); | ||
95 | |||
96 | Assert.That(itemRetrieved, Is.Not.Null); | ||
97 | Assert.That(itemRetrieved.CreatorId, Is.EqualTo(creatorId)); | ||
98 | Assert.That(itemRetrieved.Owner, Is.EqualTo(ownerId)); | ||
99 | Assert.That(itemRetrieved.AssetID, Is.EqualTo(assetId)); | ||
100 | Assert.That(itemRetrieved.Folder, Is.EqualTo(folderId)); | ||
101 | Assert.That(itemRetrieved.InvType, Is.EqualTo(invType)); | ||
102 | Assert.That(itemRetrieved.AssetType, Is.EqualTo(assetType)); | ||
103 | Assert.That(itemRetrieved.Name, Is.EqualTo(itemName)); | ||
104 | } | ||
105 | |||
106 | [Test] | ||
107 | public void TestUpdateItem() | ||
108 | { | ||
109 | TestHelpers.InMethod(); | ||
110 | // TestHelpers.EnableLogging(); | ||
111 | |||
112 | string creatorId = TestHelpers.ParseTail(0x1).ToString(); | ||
113 | UUID ownerId = TestHelpers.ParseTail(0x2); | ||
114 | UUID itemId = TestHelpers.ParseTail(0x10); | ||
115 | UUID assetId = TestHelpers.ParseTail(0x20); | ||
116 | UUID folderId = TestHelpers.ParseTail(0x30); | ||
117 | int invType = (int)InventoryType.Animation; | ||
118 | int assetType = (int)AssetType.Animation; | ||
119 | string itemName = "item1"; | ||
120 | string itemName2 = "item2"; | ||
121 | |||
122 | IInventoryService xis = CreateXInventoryService(); | ||
123 | |||
124 | InventoryItemBase itemToStore | ||
125 | = new InventoryItemBase(itemId, ownerId) | ||
126 | { | ||
127 | CreatorIdentification = creatorId.ToString(), | ||
128 | AssetID = assetId, | ||
129 | Name = itemName, | ||
130 | Folder = folderId, | ||
131 | InvType = invType, | ||
132 | AssetType = assetType | ||
133 | }; | ||
134 | |||
135 | Assert.That(xis.AddItem(itemToStore), Is.True); | ||
136 | |||
137 | // Normal update | ||
138 | itemToStore.Name = itemName2; | ||
139 | |||
140 | Assert.That(xis.UpdateItem(itemToStore), Is.True); | ||
141 | |||
142 | InventoryItemBase itemRetrieved = new InventoryItemBase(itemId); | ||
143 | itemRetrieved = xis.GetItem(itemRetrieved); | ||
144 | |||
145 | Assert.That(itemRetrieved, Is.Not.Null); | ||
146 | Assert.That(itemRetrieved.Name, Is.EqualTo(itemName2)); | ||
147 | |||
148 | // Attempt to update properties that should never change | ||
149 | string creatorId2 = TestHelpers.ParseTail(0x7).ToString(); | ||
150 | UUID ownerId2 = TestHelpers.ParseTail(0x8); | ||
151 | UUID folderId2 = TestHelpers.ParseTail(0x70); | ||
152 | int invType2 = (int)InventoryType.CallingCard; | ||
153 | int assetType2 = (int)AssetType.CallingCard; | ||
154 | string itemName3 = "item3"; | ||
155 | |||
156 | itemToStore.CreatorIdentification = creatorId2.ToString(); | ||
157 | itemToStore.Owner = ownerId2; | ||
158 | itemToStore.Folder = folderId2; | ||
159 | itemToStore.InvType = invType2; | ||
160 | itemToStore.AssetType = assetType2; | ||
161 | itemToStore.Name = itemName3; | ||
162 | |||
163 | Assert.That(xis.UpdateItem(itemToStore), Is.True); | ||
164 | |||
165 | itemRetrieved = xis.GetItem(itemRetrieved); | ||
166 | |||
167 | Assert.That(itemRetrieved, Is.Not.Null); | ||
168 | Assert.That(itemRetrieved.CreatorId, Is.EqualTo(creatorId)); | ||
169 | Assert.That(itemRetrieved.Owner, Is.EqualTo(ownerId)); | ||
170 | Assert.That(itemRetrieved.AssetID, Is.EqualTo(assetId)); | ||
171 | Assert.That(itemRetrieved.Folder, Is.EqualTo(folderId)); | ||
172 | Assert.That(itemRetrieved.InvType, Is.EqualTo(invType)); | ||
173 | Assert.That(itemRetrieved.AssetType, Is.EqualTo(assetType)); | ||
174 | Assert.That(itemRetrieved.Name, Is.EqualTo(itemName3)); | ||
175 | } | ||
176 | } | ||
177 | } \ No newline at end of file | ||
diff --git a/OpenSim/Services/InventoryService/XInventoryService.cs b/OpenSim/Services/InventoryService/XInventoryService.cs index 309dab4..00faa44 100644 --- a/OpenSim/Services/InventoryService/XInventoryService.cs +++ b/OpenSim/Services/InventoryService/XInventoryService.cs | |||
@@ -400,16 +400,7 @@ namespace OpenSim.Services.InventoryService | |||
400 | 400 | ||
401 | public virtual bool MoveFolder(InventoryFolderBase folder) | 401 | public virtual bool MoveFolder(InventoryFolderBase folder) |
402 | { | 402 | { |
403 | XInventoryFolder[] x = m_Database.GetFolders( | 403 | return m_Database.MoveFolder(folder.ID.ToString(), folder.ParentID.ToString()); |
404 | new string[] { "folderID" }, | ||
405 | new string[] { folder.ID.ToString() }); | ||
406 | |||
407 | if (x.Length == 0) | ||
408 | return false; | ||
409 | |||
410 | x[0].parentFolderID = folder.ParentID; | ||
411 | |||
412 | return m_Database.StoreFolder(x[0]); | ||
413 | } | 404 | } |
414 | 405 | ||
415 | // We don't check the principal's ID here | 406 | // We don't check the principal's ID here |
@@ -485,6 +476,46 @@ namespace OpenSim.Services.InventoryService | |||
485 | // m_log.InfoFormat( | 476 | // m_log.InfoFormat( |
486 | // "[XINVENTORY SERVICE]: Updating item {0} {1} in folder {2}", item.Name, item.ID, item.Folder); | 477 | // "[XINVENTORY SERVICE]: Updating item {0} {1} in folder {2}", item.Name, item.ID, item.Folder); |
487 | 478 | ||
479 | InventoryItemBase retrievedItem = GetItem(item); | ||
480 | |||
481 | if (retrievedItem == null) | ||
482 | { | ||
483 | m_log.WarnFormat( | ||
484 | "[XINVENTORY SERVICE]: Tried to update item {0} {1}, owner {2} but no existing item found.", | ||
485 | item.Name, item.ID, item.Owner); | ||
486 | |||
487 | return false; | ||
488 | } | ||
489 | |||
490 | // Do not allow invariants to change. Changes to folder ID occur in MoveItems() | ||
491 | if (retrievedItem.InvType != item.InvType | ||
492 | || retrievedItem.AssetType != item.AssetType | ||
493 | || retrievedItem.Folder != item.Folder | ||
494 | || retrievedItem.CreatorIdentification != item.CreatorIdentification | ||
495 | || retrievedItem.Owner != item.Owner) | ||
496 | { | ||
497 | m_log.WarnFormat( | ||
498 | "[XINVENTORY SERVICE]: Caller to UpdateItem() for {0} {1} tried to alter property(s) that should be invariant, (InvType, AssetType, Folder, CreatorIdentification, Owner), existing ({2}, {3}, {4}, {5}, {6}), update ({7}, {8}, {9}, {10}, {11})", | ||
499 | retrievedItem.Name, | ||
500 | retrievedItem.ID, | ||
501 | retrievedItem.InvType, | ||
502 | retrievedItem.AssetType, | ||
503 | retrievedItem.Folder, | ||
504 | retrievedItem.CreatorIdentification, | ||
505 | retrievedItem.Owner, | ||
506 | item.InvType, | ||
507 | item.AssetType, | ||
508 | item.Folder, | ||
509 | item.CreatorIdentification, | ||
510 | item.Owner); | ||
511 | |||
512 | item.InvType = retrievedItem.InvType; | ||
513 | item.AssetType = retrievedItem.AssetType; | ||
514 | item.Folder = retrievedItem.Folder; | ||
515 | item.CreatorIdentification = retrievedItem.CreatorIdentification; | ||
516 | item.Owner = retrievedItem.Owner; | ||
517 | } | ||
518 | |||
488 | return m_Database.StoreItem(ConvertFromOpenSim(item)); | 519 | return m_Database.StoreItem(ConvertFromOpenSim(item)); |
489 | } | 520 | } |
490 | 521 | ||
diff --git a/OpenSim/Services/LLLoginService/Properties/AssemblyInfo.cs b/OpenSim/Services/LLLoginService/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..62c6e0f --- /dev/null +++ b/OpenSim/Services/LLLoginService/Properties/AssemblyInfo.cs | |||
@@ -0,0 +1,33 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("OpenSim.Services.LLLoginService")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("http://opensimulator.org")] | ||
12 | [assembly: AssemblyProduct("OpenSim")] | ||
13 | [assembly: AssemblyCopyright("OpenSimulator developers")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("cbeb8f23-3896-4076-97fd-f955b0af6a93")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | [assembly: AssemblyVersion("0.7.5.*")] | ||
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | ||
diff --git a/OpenSim/Services/MapImageService/Properties/AssemblyInfo.cs b/OpenSim/Services/MapImageService/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..23eb664 --- /dev/null +++ b/OpenSim/Services/MapImageService/Properties/AssemblyInfo.cs | |||
@@ -0,0 +1,33 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("OpenSim.Services.MapImageService")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("http://opensimulator.org")] | ||
12 | [assembly: AssemblyProduct("OpenSim")] | ||
13 | [assembly: AssemblyCopyright("OpenSimulator developers")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("5e679df7-1d2a-401a-8966-b93677bb5839")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | [assembly: AssemblyVersion("0.7.5.*")] | ||
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | ||
diff --git a/OpenSim/Services/PresenceService/Properties/AssemblyInfo.cs b/OpenSim/Services/PresenceService/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..8c03dd7 --- /dev/null +++ b/OpenSim/Services/PresenceService/Properties/AssemblyInfo.cs | |||
@@ -0,0 +1,33 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("OpenSim.Services.PresenceService")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("http://opensimulator.org")] | ||
12 | [assembly: AssemblyProduct("OpenSim")] | ||
13 | [assembly: AssemblyCopyright("OpenSimulator developers")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("a875a0bd-eab0-40a2-b5c4-3afddc3b4d2d")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | [assembly: AssemblyVersion("0.7.5.*")] | ||
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | ||
diff --git a/OpenSim/Services/UserAccountService/Properties/AssemblyInfo.cs b/OpenSim/Services/UserAccountService/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..24e1d16 --- /dev/null +++ b/OpenSim/Services/UserAccountService/Properties/AssemblyInfo.cs | |||
@@ -0,0 +1,33 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("OpenSim.Services.UserAccountService")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("http://opensimulator.org")] | ||
12 | [assembly: AssemblyProduct("OpenSim")] | ||
13 | [assembly: AssemblyCopyright("OpenSimulator developers")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("fdb4771d-9928-4db4-aeb5-90cac2976584")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | [assembly: AssemblyVersion("0.7.5.*")] | ||
33 | [assembly: AssemblyFileVersion("1.0.0.0")] | ||