diff options
Diffstat (limited to 'OpenSim/Region/Storage')
10 files changed, 923 insertions, 922 deletions
diff --git a/OpenSim/Region/Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs b/OpenSim/Region/Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs index 39ba6e4..0a88594 100644 --- a/OpenSim/Region/Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs +++ b/OpenSim/Region/Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs | |||
@@ -1,112 +1,112 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | // BDB Support | 29 | // BDB Support |
30 | // Apparently broken on Mono | 30 | // Apparently broken on Mono |
31 | 31 | ||
32 | using BerkeleyDb; | 32 | using BerkeleyDb; |
33 | using libsecondlife; | 33 | using libsecondlife; |
34 | using OpenSim.Framework.Interfaces; | 34 | using OpenSim.Framework.Interfaces; |
35 | using OpenSim.Framework.Types; | 35 | using OpenSim.Framework.Types; |
36 | 36 | ||
37 | namespace OpenSim.Region.Storage.LocalStorageBDB | 37 | namespace OpenSim.Region.Storage.LocalStorageBDB |
38 | { | 38 | { |
39 | public class BDBLocalStorage : ILocalStorage | 39 | public class BDBLocalStorage : ILocalStorage |
40 | { | 40 | { |
41 | const string simDbName = "localsim.db"; | 41 | const string simDbName = "localsim.db"; |
42 | 42 | ||
43 | DbHash sim; | 43 | DbHash sim; |
44 | Db DB; | 44 | Db DB; |
45 | //BEFormatter formatter; | 45 | //BEFormatter formatter; |
46 | 46 | ||
47 | public BDBLocalStorage() | 47 | public BDBLocalStorage() |
48 | { | 48 | { |
49 | DB = new Db(DbCreateFlags.None); | 49 | DB = new Db(DbCreateFlags.None); |
50 | sim = (DbHash)DB.Open(null, simDbName, null, DbType.Hash, Db.OpenFlags.Create, 0); | 50 | sim = (DbHash)DB.Open(null, simDbName, null, DbType.Hash, Db.OpenFlags.Create, 0); |
51 | //vendorDb = (DbBTree)db.Open(null, VendorDbName, null, DbType.BTree, Db.OpenFlags.Create, 0); | 51 | //vendorDb = (DbBTree)db.Open(null, VendorDbName, null, DbType.BTree, Db.OpenFlags.Create, 0); |
52 | } | 52 | } |
53 | 53 | ||
54 | public void Initialise(string file) | 54 | public void Initialise(string file) |
55 | { | 55 | { |
56 | // Blank | 56 | // Blank |
57 | } | 57 | } |
58 | 58 | ||
59 | public void StorePrim(PrimData prim) | 59 | public void StorePrim(PrimData prim) |
60 | { | 60 | { |
61 | DbEntry key = new DbEntry(); | 61 | DbEntry key = new DbEntry(); |
62 | DbEntry data = new DbEntry(); | 62 | DbEntry data = new DbEntry(); |
63 | lock (sim) | 63 | lock (sim) |
64 | { | 64 | { |
65 | sim.PutUnique(null, ref key, ref data, DbFile.WriteFlags.AutoCommit); | 65 | sim.PutUnique(null, ref key, ref data, DbFile.WriteFlags.AutoCommit); |
66 | } | 66 | } |
67 | } | 67 | } |
68 | public void RemovePrim(LLUUID primID) | 68 | public void RemovePrim(LLUUID primID) |
69 | { | 69 | { |
70 | 70 | ||
71 | } | 71 | } |
72 | public void LoadPrimitives(ILocalStorageReceiver receiver) | 72 | public void LoadPrimitives(ILocalStorageReceiver receiver) |
73 | { | 73 | { |
74 | 74 | ||
75 | } | 75 | } |
76 | public float[] LoadWorld() | 76 | public float[] LoadWorld() |
77 | { | 77 | { |
78 | return new float[65536]; | 78 | return new float[65536]; |
79 | } | 79 | } |
80 | public void SaveMap(float[] heightmap) | 80 | public void SaveMap(float[] heightmap) |
81 | { | 81 | { |
82 | 82 | ||
83 | } | 83 | } |
84 | 84 | ||
85 | public void SaveParcels(ParcelData[] parcel_data) | 85 | public void SaveParcels(ParcelData[] parcel_data) |
86 | { | 86 | { |
87 | } | 87 | } |
88 | 88 | ||
89 | public void SaveParcel(ParcelData parcel) | 89 | public void SaveParcel(ParcelData parcel) |
90 | { | 90 | { |
91 | } | 91 | } |
92 | 92 | ||
93 | public void RemoveParcel(ParcelData parcel) | 93 | public void RemoveParcel(ParcelData parcel) |
94 | { | 94 | { |
95 | } | 95 | } |
96 | 96 | ||
97 | public void RemoveAllParcels() | 97 | public void RemoveAllParcels() |
98 | { | 98 | { |
99 | } | 99 | } |
100 | 100 | ||
101 | public void LoadParcels(ILocalStorageParcelReceiver recv) | 101 | public void LoadParcels(ILocalStorageParcelReceiver recv) |
102 | { | 102 | { |
103 | recv.NoParcelDataFromStorage(); | 103 | recv.NoParcelDataFromStorage(); |
104 | } | 104 | } |
105 | 105 | ||
106 | public void ShutDown() | 106 | public void ShutDown() |
107 | { | 107 | { |
108 | sim.GetDb().Close(); | 108 | sim.GetDb().Close(); |
109 | DB.Close(); | 109 | DB.Close(); |
110 | } | 110 | } |
111 | } | 111 | } |
112 | } \ No newline at end of file | 112 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Storage/LocalStorageDb4o/AssemblyInfo.cs b/OpenSim/Region/Storage/LocalStorageDb4o/AssemblyInfo.cs index 4463ac9..a3aac18 100644 --- a/OpenSim/Region/Storage/LocalStorageDb4o/AssemblyInfo.cs +++ b/OpenSim/Region/Storage/LocalStorageDb4o/AssemblyInfo.cs | |||
@@ -1,56 +1,56 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using System.Reflection; | 28 | using System.Reflection; |
29 | using System.Runtime.InteropServices; | 29 | using System.Runtime.InteropServices; |
30 | // Information about this assembly is defined by the following | 30 | // Information about this assembly is defined by the following |
31 | // attributes. | 31 | // attributes. |
32 | // | 32 | // |
33 | // change them to the information which is associated with the assembly | 33 | // change them to the information which is associated with the assembly |
34 | // you compile. | 34 | // you compile. |
35 | 35 | ||
36 | [assembly: AssemblyTitle("Db4LocalStorage")] | 36 | [assembly: AssemblyTitle("Db4LocalStorage")] |
37 | [assembly: AssemblyDescription("")] | 37 | [assembly: AssemblyDescription("")] |
38 | [assembly: AssemblyConfiguration("")] | 38 | [assembly: AssemblyConfiguration("")] |
39 | [assembly: AssemblyCompany("")] | 39 | [assembly: AssemblyCompany("")] |
40 | [assembly: AssemblyProduct("Db4LocalStorage")] | 40 | [assembly: AssemblyProduct("Db4LocalStorage")] |
41 | [assembly: AssemblyCopyright("")] | 41 | [assembly: AssemblyCopyright("")] |
42 | [assembly: AssemblyTrademark("")] | 42 | [assembly: AssemblyTrademark("")] |
43 | [assembly: AssemblyCulture("")] | 43 | [assembly: AssemblyCulture("")] |
44 | 44 | ||
45 | // This sets the default COM visibility of types in the assembly to invisible. | 45 | // This sets the default COM visibility of types in the assembly to invisible. |
46 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. | 46 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. |
47 | [assembly: ComVisible(false)] | 47 | [assembly: ComVisible(false)] |
48 | 48 | ||
49 | // The assembly version has following format : | 49 | // The assembly version has following format : |
50 | // | 50 | // |
51 | // Major.Minor.Build.Revision | 51 | // Major.Minor.Build.Revision |
52 | // | 52 | // |
53 | // You can specify all values by your own or you can build default build and revision | 53 | // You can specify all values by your own or you can build default build and revision |
54 | // numbers with the '*' character (the default): | 54 | // numbers with the '*' character (the default): |
55 | 55 | ||
56 | [assembly: AssemblyVersion("1.0.*")] | 56 | [assembly: AssemblyVersion("1.0.*")] |
diff --git a/OpenSim/Region/Storage/LocalStorageDb4o/Db4LocalStorage.cs b/OpenSim/Region/Storage/LocalStorageDb4o/Db4LocalStorage.cs index 8214bc8..8d9f473 100644 --- a/OpenSim/Region/Storage/LocalStorageDb4o/Db4LocalStorage.cs +++ b/OpenSim/Region/Storage/LocalStorageDb4o/Db4LocalStorage.cs | |||
@@ -1,267 +1,267 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using System; | 28 | using System; |
29 | using Db4objects.Db4o; | 29 | using Db4objects.Db4o; |
30 | using libsecondlife; | 30 | using libsecondlife; |
31 | using OpenSim.Framework.Console; | 31 | using OpenSim.Framework.Console; |
32 | using OpenSim.Framework.Interfaces; | 32 | using OpenSim.Framework.Interfaces; |
33 | using OpenSim.Framework.Types; | 33 | using OpenSim.Framework.Types; |
34 | 34 | ||
35 | namespace OpenSim.Region.Storage.LocalStorageDb4o | 35 | namespace OpenSim.Region.Storage.LocalStorageDb4o |
36 | { | 36 | { |
37 | /// <summary> | 37 | /// <summary> |
38 | /// | 38 | /// |
39 | /// </summary> | 39 | /// </summary> |
40 | public class Db4LocalStorage : ILocalStorage | 40 | public class Db4LocalStorage : ILocalStorage |
41 | { | 41 | { |
42 | private IObjectContainer db; | 42 | private IObjectContainer db; |
43 | private string datastore; | 43 | private string datastore; |
44 | 44 | ||
45 | public Db4LocalStorage() | 45 | public Db4LocalStorage() |
46 | { | 46 | { |
47 | 47 | ||
48 | } | 48 | } |
49 | 49 | ||
50 | public void Initialise(string dfile) | 50 | public void Initialise(string dfile) |
51 | { | 51 | { |
52 | MainLog.Instance.Warn("Db4LocalStorage Opening " + dfile); | 52 | MainLog.Instance.Warn("Db4LocalStorage Opening " + dfile); |
53 | datastore = dfile; | 53 | datastore = dfile; |
54 | try | 54 | try |
55 | { | 55 | { |
56 | db = Db4oFactory.OpenFile(datastore); | 56 | db = Db4oFactory.OpenFile(datastore); |
57 | MainLog.Instance.Verbose("Db4LocalStorage creation"); | 57 | MainLog.Instance.Verbose("Db4LocalStorage creation"); |
58 | } | 58 | } |
59 | catch (Exception e) | 59 | catch (Exception e) |
60 | { | 60 | { |
61 | db.Close(); | 61 | db.Close(); |
62 | MainLog.Instance.Warn("Db4LocalStorage :Constructor - Exception occured"); | 62 | MainLog.Instance.Warn("Db4LocalStorage :Constructor - Exception occured"); |
63 | MainLog.Instance.Warn(e.ToString()); | 63 | MainLog.Instance.Warn(e.ToString()); |
64 | } | 64 | } |
65 | } | 65 | } |
66 | 66 | ||
67 | public void StorePrim(PrimData prim) | 67 | public void StorePrim(PrimData prim) |
68 | { | 68 | { |
69 | IObjectSet result = db.Query(new UUIDPrimQuery(prim.FullID)); | 69 | IObjectSet result = db.Query(new UUIDPrimQuery(prim.FullID)); |
70 | if (result.Count > 0) | 70 | if (result.Count > 0) |
71 | { | 71 | { |
72 | //prim already in storage | 72 | //prim already in storage |
73 | //so update it | 73 | //so update it |
74 | PrimData found = (PrimData)result.Next(); | 74 | PrimData found = (PrimData)result.Next(); |
75 | found.PathBegin = prim.PathBegin; | 75 | found.PathBegin = prim.PathBegin; |
76 | found.PathCurve = prim.PathCurve; | 76 | found.PathCurve = prim.PathCurve; |
77 | found.PathEnd = prim.PathEnd; | 77 | found.PathEnd = prim.PathEnd; |
78 | found.PathRadiusOffset = prim.PathRadiusOffset; | 78 | found.PathRadiusOffset = prim.PathRadiusOffset; |
79 | found.PathRevolutions = prim.PathRevolutions; | 79 | found.PathRevolutions = prim.PathRevolutions; |
80 | found.PathScaleX = prim.PathScaleX; | 80 | found.PathScaleX = prim.PathScaleX; |
81 | found.PathScaleY = prim.PathScaleY; | 81 | found.PathScaleY = prim.PathScaleY; |
82 | found.PathShearX = prim.PathShearX; | 82 | found.PathShearX = prim.PathShearX; |
83 | found.PathShearY = prim.PathShearY; | 83 | found.PathShearY = prim.PathShearY; |
84 | found.PathSkew = prim.PathSkew; | 84 | found.PathSkew = prim.PathSkew; |
85 | found.PathTaperX = prim.PathTaperX; | 85 | found.PathTaperX = prim.PathTaperX; |
86 | found.PathTaperY = prim.PathTaperY; | 86 | found.PathTaperY = prim.PathTaperY; |
87 | found.PathTwist = prim.PathTwist; | 87 | found.PathTwist = prim.PathTwist; |
88 | found.PathTwistBegin = prim.PathTwistBegin; | 88 | found.PathTwistBegin = prim.PathTwistBegin; |
89 | found.PCode = prim.PCode; | 89 | found.PCode = prim.PCode; |
90 | found.ProfileBegin = prim.ProfileBegin; | 90 | found.ProfileBegin = prim.ProfileBegin; |
91 | found.ProfileCurve = prim.ProfileCurve; | 91 | found.ProfileCurve = prim.ProfileCurve; |
92 | found.ProfileEnd = prim.ProfileEnd; | 92 | found.ProfileEnd = prim.ProfileEnd; |
93 | found.ProfileHollow = prim.ProfileHollow; | 93 | found.ProfileHollow = prim.ProfileHollow; |
94 | found.Position = prim.Position; | 94 | found.Position = prim.Position; |
95 | found.Rotation = prim.Rotation; | 95 | found.Rotation = prim.Rotation; |
96 | found.TextureEntry = prim.TextureEntry; | 96 | found.TextureEntry = prim.TextureEntry; |
97 | db.Set(found); | 97 | db.Set(found); |
98 | db.Commit(); | 98 | db.Commit(); |
99 | } | 99 | } |
100 | else | 100 | else |
101 | { | 101 | { |
102 | //not in storage | 102 | //not in storage |
103 | db.Set(prim); | 103 | db.Set(prim); |
104 | db.Commit(); | 104 | db.Commit(); |
105 | } | 105 | } |
106 | } | 106 | } |
107 | 107 | ||
108 | public void RemovePrim(LLUUID primID) | 108 | public void RemovePrim(LLUUID primID) |
109 | { | 109 | { |
110 | IObjectSet result = db.Query(new UUIDPrimQuery(primID)); | 110 | IObjectSet result = db.Query(new UUIDPrimQuery(primID)); |
111 | if (result.Count > 0) | 111 | if (result.Count > 0) |
112 | { | 112 | { |
113 | PrimData found = (PrimData)result.Next(); | 113 | PrimData found = (PrimData)result.Next(); |
114 | db.Delete(found); | 114 | db.Delete(found); |
115 | } | 115 | } |
116 | } | 116 | } |
117 | 117 | ||
118 | 118 | ||
119 | public void LoadPrimitives(ILocalStorageReceiver receiver) | 119 | public void LoadPrimitives(ILocalStorageReceiver receiver) |
120 | { | 120 | { |
121 | IObjectSet result = db.Get(typeof(PrimData)); | 121 | IObjectSet result = db.Get(typeof(PrimData)); |
122 | MainLog.Instance.Verbose("Db4LocalStorage.cs: LoadPrimitives() - number of prims in storages is " + result.Count); | 122 | MainLog.Instance.Verbose("Db4LocalStorage.cs: LoadPrimitives() - number of prims in storages is " + result.Count); |
123 | foreach (PrimData prim in result) | 123 | foreach (PrimData prim in result) |
124 | { | 124 | { |
125 | receiver.PrimFromStorage(prim); | 125 | receiver.PrimFromStorage(prim); |
126 | } | 126 | } |
127 | } | 127 | } |
128 | 128 | ||
129 | public float[] LoadWorld() | 129 | public float[] LoadWorld() |
130 | { | 130 | { |
131 | MainLog.Instance.Verbose("LoadWorld() - Loading world...."); | 131 | MainLog.Instance.Verbose("LoadWorld() - Loading world...."); |
132 | float[] heightmap = null; | 132 | float[] heightmap = null; |
133 | MainLog.Instance.Verbose("LoadWorld() - Looking for a heightmap in local DB"); | 133 | MainLog.Instance.Verbose("LoadWorld() - Looking for a heightmap in local DB"); |
134 | IObjectSet world_result = db.Get(typeof(MapStorage)); | 134 | IObjectSet world_result = db.Get(typeof(MapStorage)); |
135 | if (world_result.Count > 0) | 135 | if (world_result.Count > 0) |
136 | { | 136 | { |
137 | MainLog.Instance.Verbose("LoadWorld() - Found a heightmap in local database, loading"); | 137 | MainLog.Instance.Verbose("LoadWorld() - Found a heightmap in local database, loading"); |
138 | MapStorage map = (MapStorage)world_result.Next(); | 138 | MapStorage map = (MapStorage)world_result.Next(); |
139 | //blank.LandMap = map.Map; | 139 | //blank.LandMap = map.Map; |
140 | heightmap = map.Map; | 140 | heightmap = map.Map; |
141 | } | 141 | } |
142 | return heightmap; | 142 | return heightmap; |
143 | } | 143 | } |
144 | 144 | ||
145 | public void SaveMap(float[] heightmap) | 145 | public void SaveMap(float[] heightmap) |
146 | { | 146 | { |
147 | IObjectSet world_result = db.Get(typeof(MapStorage)); | 147 | IObjectSet world_result = db.Get(typeof(MapStorage)); |
148 | if (world_result.Count > 0) | 148 | if (world_result.Count > 0) |
149 | { | 149 | { |
150 | MainLog.Instance.Verbose("SaveWorld() - updating saved copy of heightmap in local database"); | 150 | MainLog.Instance.Verbose("SaveWorld() - updating saved copy of heightmap in local database"); |
151 | MapStorage map = (MapStorage)world_result.Next(); | 151 | MapStorage map = (MapStorage)world_result.Next(); |
152 | db.Delete(map); | 152 | db.Delete(map); |
153 | } | 153 | } |
154 | MapStorage map1 = new MapStorage(); | 154 | MapStorage map1 = new MapStorage(); |
155 | map1.Map = heightmap; //OpenSim_Main.local_world.LandMap; | 155 | map1.Map = heightmap; //OpenSim_Main.local_world.LandMap; |
156 | db.Set(map1); | 156 | db.Set(map1); |
157 | db.Commit(); | 157 | db.Commit(); |
158 | } | 158 | } |
159 | 159 | ||
160 | public void SaveParcel(ParcelData parcel) | 160 | public void SaveParcel(ParcelData parcel) |
161 | { | 161 | { |
162 | IObjectSet result = db.Query(new UUIDParcelQuery(parcel.globalID)); | 162 | IObjectSet result = db.Query(new UUIDParcelQuery(parcel.globalID)); |
163 | if (result.Count > 0) | 163 | if (result.Count > 0) |
164 | { | 164 | { |
165 | //Old Parcel | 165 | //Old Parcel |
166 | ParcelData updateParcel = (ParcelData)result.Next(); | 166 | ParcelData updateParcel = (ParcelData)result.Next(); |
167 | updateParcel.AABBMax = parcel.AABBMax; | 167 | updateParcel.AABBMax = parcel.AABBMax; |
168 | updateParcel.AABBMin = parcel.AABBMin; | 168 | updateParcel.AABBMin = parcel.AABBMin; |
169 | updateParcel.area = parcel.area; | 169 | updateParcel.area = parcel.area; |
170 | updateParcel.auctionID = parcel.auctionID; | 170 | updateParcel.auctionID = parcel.auctionID; |
171 | updateParcel.authBuyerID = parcel.authBuyerID; | 171 | updateParcel.authBuyerID = parcel.authBuyerID; |
172 | updateParcel.category = parcel.category; | 172 | updateParcel.category = parcel.category; |
173 | updateParcel.claimDate = parcel.claimDate; | 173 | updateParcel.claimDate = parcel.claimDate; |
174 | updateParcel.claimPrice = parcel.claimPrice; | 174 | updateParcel.claimPrice = parcel.claimPrice; |
175 | updateParcel.groupID = parcel.groupID; | 175 | updateParcel.groupID = parcel.groupID; |
176 | updateParcel.groupPrims = parcel.groupPrims; | 176 | updateParcel.groupPrims = parcel.groupPrims; |
177 | updateParcel.isGroupOwned = parcel.isGroupOwned; | 177 | updateParcel.isGroupOwned = parcel.isGroupOwned; |
178 | updateParcel.landingType = parcel.landingType; | 178 | updateParcel.landingType = parcel.landingType; |
179 | updateParcel.mediaAutoScale = parcel.mediaAutoScale; | 179 | updateParcel.mediaAutoScale = parcel.mediaAutoScale; |
180 | updateParcel.mediaID = parcel.mediaID; | 180 | updateParcel.mediaID = parcel.mediaID; |
181 | updateParcel.mediaURL = parcel.mediaURL; | 181 | updateParcel.mediaURL = parcel.mediaURL; |
182 | updateParcel.musicURL = parcel.musicURL; | 182 | updateParcel.musicURL = parcel.musicURL; |
183 | updateParcel.localID = parcel.localID; | 183 | updateParcel.localID = parcel.localID; |
184 | updateParcel.ownerID = parcel.ownerID; | 184 | updateParcel.ownerID = parcel.ownerID; |
185 | updateParcel.passHours = parcel.passHours; | 185 | updateParcel.passHours = parcel.passHours; |
186 | updateParcel.passPrice = parcel.passPrice; | 186 | updateParcel.passPrice = parcel.passPrice; |
187 | updateParcel.parcelBitmapByteArray = (byte[])parcel.parcelBitmapByteArray.Clone(); | 187 | updateParcel.parcelBitmapByteArray = (byte[])parcel.parcelBitmapByteArray.Clone(); |
188 | updateParcel.parcelDesc = parcel.parcelDesc; | 188 | updateParcel.parcelDesc = parcel.parcelDesc; |
189 | updateParcel.parcelFlags = parcel.parcelFlags; | 189 | updateParcel.parcelFlags = parcel.parcelFlags; |
190 | updateParcel.parcelName = parcel.parcelName; | 190 | updateParcel.parcelName = parcel.parcelName; |
191 | updateParcel.parcelStatus = parcel.parcelStatus; | 191 | updateParcel.parcelStatus = parcel.parcelStatus; |
192 | updateParcel.salePrice = parcel.salePrice; | 192 | updateParcel.salePrice = parcel.salePrice; |
193 | updateParcel.snapshotID = parcel.snapshotID; | 193 | updateParcel.snapshotID = parcel.snapshotID; |
194 | updateParcel.userLocation = parcel.userLocation; | 194 | updateParcel.userLocation = parcel.userLocation; |
195 | updateParcel.userLookAt = parcel.userLookAt; | 195 | updateParcel.userLookAt = parcel.userLookAt; |
196 | 196 | ||
197 | db.Set(updateParcel); | 197 | db.Set(updateParcel); |
198 | } | 198 | } |
199 | else | 199 | else |
200 | { | 200 | { |
201 | db.Set(parcel); | 201 | db.Set(parcel); |
202 | } | 202 | } |
203 | db.Commit(); | 203 | db.Commit(); |
204 | } | 204 | } |
205 | 205 | ||
206 | public void SaveParcels(ParcelData[] parcel_data) | 206 | public void SaveParcels(ParcelData[] parcel_data) |
207 | { | 207 | { |
208 | MainLog.Instance.Notice("Parcel Backup: Saving Parcels..."); | 208 | MainLog.Instance.Notice("Parcel Backup: Saving Parcels..."); |
209 | int i; | 209 | int i; |
210 | for (i = 0; i < parcel_data.GetLength(0); i++) | 210 | for (i = 0; i < parcel_data.GetLength(0); i++) |
211 | { | 211 | { |
212 | 212 | ||
213 | SaveParcel(parcel_data[i]); | 213 | SaveParcel(parcel_data[i]); |
214 | 214 | ||
215 | } | 215 | } |
216 | MainLog.Instance.Notice("Parcel Backup: Parcel Save Complete"); | 216 | MainLog.Instance.Notice("Parcel Backup: Parcel Save Complete"); |
217 | } | 217 | } |
218 | 218 | ||
219 | public void RemoveParcel(ParcelData parcel) | 219 | public void RemoveParcel(ParcelData parcel) |
220 | { | 220 | { |
221 | IObjectSet result = db.Query(new UUIDParcelQuery(parcel.globalID)); | 221 | IObjectSet result = db.Query(new UUIDParcelQuery(parcel.globalID)); |
222 | if (result.Count > 0) | 222 | if (result.Count > 0) |
223 | { | 223 | { |
224 | db.Delete(result[0]); | 224 | db.Delete(result[0]); |
225 | } | 225 | } |
226 | db.Commit(); | 226 | db.Commit(); |
227 | } | 227 | } |
228 | public void RemoveAllParcels() | 228 | public void RemoveAllParcels() |
229 | { | 229 | { |
230 | MainLog.Instance.Notice("Parcel Backup: Removing all parcels..."); | 230 | MainLog.Instance.Notice("Parcel Backup: Removing all parcels..."); |
231 | IObjectSet result = db.Get(typeof(ParcelData)); | 231 | IObjectSet result = db.Get(typeof(ParcelData)); |
232 | if (result.Count > 0) | 232 | if (result.Count > 0) |
233 | { | 233 | { |
234 | foreach (ParcelData parcelData in result) | 234 | foreach (ParcelData parcelData in result) |
235 | { | 235 | { |
236 | RemoveParcel(parcelData); | 236 | RemoveParcel(parcelData); |
237 | } | 237 | } |
238 | } | 238 | } |
239 | } | 239 | } |
240 | 240 | ||
241 | public void LoadParcels(ILocalStorageParcelReceiver recv) | 241 | public void LoadParcels(ILocalStorageParcelReceiver recv) |
242 | { | 242 | { |
243 | MainLog.Instance.Notice("Parcel Backup: Loading Parcels..."); | 243 | MainLog.Instance.Notice("Parcel Backup: Loading Parcels..."); |
244 | IObjectSet result = db.Get(typeof(ParcelData)); | 244 | IObjectSet result = db.Get(typeof(ParcelData)); |
245 | if (result.Count > 0) | 245 | if (result.Count > 0) |
246 | { | 246 | { |
247 | MainLog.Instance.Notice("Parcel Backup: Parcels exist in database."); | 247 | MainLog.Instance.Notice("Parcel Backup: Parcels exist in database."); |
248 | foreach (ParcelData parcelData in result) | 248 | foreach (ParcelData parcelData in result) |
249 | { | 249 | { |
250 | 250 | ||
251 | recv.ParcelFromStorage(parcelData); | 251 | recv.ParcelFromStorage(parcelData); |
252 | } | 252 | } |
253 | } | 253 | } |
254 | else | 254 | else |
255 | { | 255 | { |
256 | MainLog.Instance.Notice("Parcel Backup: No parcels exist. Creating basic parcel."); | 256 | MainLog.Instance.Notice("Parcel Backup: No parcels exist. Creating basic parcel."); |
257 | recv.NoParcelDataFromStorage(); | 257 | recv.NoParcelDataFromStorage(); |
258 | } | 258 | } |
259 | MainLog.Instance.Notice("Parcel Backup: Parcels Restored"); | 259 | MainLog.Instance.Notice("Parcel Backup: Parcels Restored"); |
260 | } | 260 | } |
261 | public void ShutDown() | 261 | public void ShutDown() |
262 | { | 262 | { |
263 | db.Commit(); | 263 | db.Commit(); |
264 | db.Close(); | 264 | db.Close(); |
265 | } | 265 | } |
266 | } | 266 | } |
267 | } \ No newline at end of file | 267 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Storage/LocalStorageDb4o/MapStorage.cs b/OpenSim/Region/Storage/LocalStorageDb4o/MapStorage.cs index ec82d02..3a5dd19 100644 --- a/OpenSim/Region/Storage/LocalStorageDb4o/MapStorage.cs +++ b/OpenSim/Region/Storage/LocalStorageDb4o/MapStorage.cs | |||
@@ -1,39 +1,39 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | namespace OpenSim.Region.Storage.LocalStorageDb4o | 28 | namespace OpenSim.Region.Storage.LocalStorageDb4o |
29 | { | 29 | { |
30 | public class MapStorage | 30 | public class MapStorage |
31 | { | 31 | { |
32 | public float[] Map; | 32 | public float[] Map; |
33 | 33 | ||
34 | public MapStorage() | 34 | public MapStorage() |
35 | { | 35 | { |
36 | 36 | ||
37 | } | 37 | } |
38 | } | 38 | } |
39 | } \ No newline at end of file | 39 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Storage/LocalStorageDb4o/UUIDParcelQuery.cs b/OpenSim/Region/Storage/LocalStorageDb4o/UUIDParcelQuery.cs index 6e6768c..debaa88 100644 --- a/OpenSim/Region/Storage/LocalStorageDb4o/UUIDParcelQuery.cs +++ b/OpenSim/Region/Storage/LocalStorageDb4o/UUIDParcelQuery.cs | |||
@@ -1,47 +1,47 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using Db4objects.Db4o.Query; | 28 | using Db4objects.Db4o.Query; |
29 | using libsecondlife; | 29 | using libsecondlife; |
30 | using OpenSim.Framework.Types; | 30 | using OpenSim.Framework.Types; |
31 | 31 | ||
32 | namespace OpenSim.Region.Storage.LocalStorageDb4o | 32 | namespace OpenSim.Region.Storage.LocalStorageDb4o |
33 | { | 33 | { |
34 | public class UUIDParcelQuery : Predicate | 34 | public class UUIDParcelQuery : Predicate |
35 | { | 35 | { |
36 | private LLUUID globalIDSearch; | 36 | private LLUUID globalIDSearch; |
37 | 37 | ||
38 | public UUIDParcelQuery(LLUUID find) | 38 | public UUIDParcelQuery(LLUUID find) |
39 | { | 39 | { |
40 | globalIDSearch = find; | 40 | globalIDSearch = find; |
41 | } | 41 | } |
42 | public bool Match(ParcelData parcel) | 42 | public bool Match(ParcelData parcel) |
43 | { | 43 | { |
44 | return (parcel.globalID == globalIDSearch); | 44 | return (parcel.globalID == globalIDSearch); |
45 | } | 45 | } |
46 | } | 46 | } |
47 | } | 47 | } |
diff --git a/OpenSim/Region/Storage/LocalStorageDb4o/UUIDPrimQuery.cs b/OpenSim/Region/Storage/LocalStorageDb4o/UUIDPrimQuery.cs index eb309cb..d5077ff 100644 --- a/OpenSim/Region/Storage/LocalStorageDb4o/UUIDPrimQuery.cs +++ b/OpenSim/Region/Storage/LocalStorageDb4o/UUIDPrimQuery.cs | |||
@@ -1,47 +1,47 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using Db4objects.Db4o.Query; | 28 | using Db4objects.Db4o.Query; |
29 | using libsecondlife; | 29 | using libsecondlife; |
30 | using OpenSim.Framework.Types; | 30 | using OpenSim.Framework.Types; |
31 | 31 | ||
32 | namespace OpenSim.Region.Storage.LocalStorageDb4o | 32 | namespace OpenSim.Region.Storage.LocalStorageDb4o |
33 | { | 33 | { |
34 | public class UUIDPrimQuery : Predicate | 34 | public class UUIDPrimQuery : Predicate |
35 | { | 35 | { |
36 | private LLUUID _findID; | 36 | private LLUUID _findID; |
37 | 37 | ||
38 | public UUIDPrimQuery(LLUUID find) | 38 | public UUIDPrimQuery(LLUUID find) |
39 | { | 39 | { |
40 | _findID = find; | 40 | _findID = find; |
41 | } | 41 | } |
42 | public bool Match(PrimData prim) | 42 | public bool Match(PrimData prim) |
43 | { | 43 | { |
44 | return (prim.FullID == _findID); | 44 | return (prim.FullID == _findID); |
45 | } | 45 | } |
46 | } | 46 | } |
47 | } | 47 | } |
diff --git a/OpenSim/Region/Storage/LocalStorageSQLite/Properties/AssemblyInfo.cs b/OpenSim/Region/Storage/LocalStorageSQLite/Properties/AssemblyInfo.cs index 7bc1cc5..6bbaf0f 100644 --- a/OpenSim/Region/Storage/LocalStorageSQLite/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/Storage/LocalStorageSQLite/Properties/AssemblyInfo.cs | |||
@@ -1,60 +1,60 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using System.Reflection; | 28 | using System.Reflection; |
29 | using System.Runtime.InteropServices; | 29 | using System.Runtime.InteropServices; |
30 | // General Information about an assembly is controlled through the following | 30 | // General Information about an assembly is controlled through the following |
31 | // set of attributes. Change these attribute values to modify the information | 31 | // set of attributes. Change these attribute values to modify the information |
32 | // associated with an assembly. | 32 | // associated with an assembly. |
33 | [assembly: AssemblyTitle("OpenSim.Region.Storage.LocalStorageSQLite")] | 33 | [assembly: AssemblyTitle("OpenSim.Region.Storage.LocalStorageSQLite")] |
34 | [assembly: AssemblyDescription("")] | 34 | [assembly: AssemblyDescription("")] |
35 | [assembly: AssemblyConfiguration("")] | 35 | [assembly: AssemblyConfiguration("")] |
36 | [assembly: AssemblyCompany("")] | 36 | [assembly: AssemblyCompany("")] |
37 | [assembly: AssemblyProduct("OpenSim.Region.Storage.LocalStorageSQLite")] | 37 | [assembly: AssemblyProduct("OpenSim.Region.Storage.LocalStorageSQLite")] |
38 | [assembly: AssemblyCopyright("Copyright © 2007")] | 38 | [assembly: AssemblyCopyright("Copyright © 2007")] |
39 | [assembly: AssemblyTrademark("")] | 39 | [assembly: AssemblyTrademark("")] |
40 | [assembly: AssemblyCulture("")] | 40 | [assembly: AssemblyCulture("")] |
41 | 41 | ||
42 | // Setting ComVisible to false makes the types in this assembly not visible | 42 | // Setting ComVisible to false makes the types in this assembly not visible |
43 | // to COM components. If you need to access a type in this assembly from | 43 | // to COM components. If you need to access a type in this assembly from |
44 | // COM, set the ComVisible attribute to true on that type. | 44 | // COM, set the ComVisible attribute to true on that type. |
45 | [assembly: ComVisible(false)] | 45 | [assembly: ComVisible(false)] |
46 | 46 | ||
47 | // The following GUID is for the ID of the typelib if this project is exposed to COM | 47 | // The following GUID is for the ID of the typelib if this project is exposed to COM |
48 | [assembly: Guid("ecd6e0c1-7909-413e-9e3f-659678ac3bc3")] | 48 | [assembly: Guid("ecd6e0c1-7909-413e-9e3f-659678ac3bc3")] |
49 | 49 | ||
50 | // Version information for an assembly consists of the following four values: | 50 | // Version information for an assembly consists of the following four values: |
51 | // | 51 | // |
52 | // Major Version | 52 | // Major Version |
53 | // Minor Version | 53 | // Minor Version |
54 | // Build Number | 54 | // Build Number |
55 | // Revision | 55 | // Revision |
56 | // | 56 | // |
57 | // You can specify all the values or you can default the Revision and Build Numbers | 57 | // You can specify all the values or you can default the Revision and Build Numbers |
58 | // by using the '*' as shown below: | 58 | // by using the '*' as shown below: |
59 | [assembly: AssemblyVersion("1.0.0.0")] | 59 | [assembly: AssemblyVersion("1.0.0.0")] |
60 | [assembly: AssemblyFileVersion("1.0.0.0")] | 60 | [assembly: AssemblyFileVersion("1.0.0.0")] |
diff --git a/OpenSim/Region/Storage/LocalStorageSQLite/SQLiteLocalStorage.cs b/OpenSim/Region/Storage/LocalStorageSQLite/SQLiteLocalStorage.cs index 9900a98..599ff6c 100644 --- a/OpenSim/Region/Storage/LocalStorageSQLite/SQLiteLocalStorage.cs +++ b/OpenSim/Region/Storage/LocalStorageSQLite/SQLiteLocalStorage.cs | |||
@@ -1,198 +1,198 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 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 | 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 | 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 | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | // SQLite Support | 29 | // SQLite Support |
30 | // A bad idea, but the IRC people told me to! | 30 | // A bad idea, but the IRC people told me to! |
31 | 31 | ||
32 | using System; | 32 | using System; |
33 | using System.Data; | 33 | using System.Data; |
34 | using System.Data.SQLite; | 34 | using System.Data.SQLite; |
35 | using libsecondlife; | 35 | using libsecondlife; |
36 | using OpenSim.Framework.Console; | 36 | using OpenSim.Framework.Console; |
37 | using OpenSim.Framework.Interfaces; | 37 | using OpenSim.Framework.Interfaces; |
38 | using OpenSim.Framework.Types; | 38 | using OpenSim.Framework.Types; |
39 | 39 | ||
40 | namespace OpenSim.Region.Storage.LocalStorageSQLite | 40 | namespace OpenSim.Region.Storage.LocalStorageSQLite |
41 | { | 41 | { |
42 | public class SQLiteLocalStorage : ILocalStorage | 42 | public class SQLiteLocalStorage : ILocalStorage |
43 | { | 43 | { |
44 | IDbConnection db; | 44 | IDbConnection db; |
45 | 45 | ||
46 | public SQLiteLocalStorage() | 46 | public SQLiteLocalStorage() |
47 | { | 47 | { |
48 | try | 48 | try |
49 | { | 49 | { |
50 | string connectionstring = "URI=file:localsim.sdb"; | 50 | string connectionstring = "URI=file:localsim.sdb"; |
51 | db = (IDbConnection)new SQLiteConnection(connectionstring); | 51 | db = (IDbConnection)new SQLiteConnection(connectionstring); |
52 | db.Open(); | 52 | db.Open(); |
53 | } | 53 | } |
54 | catch (Exception e) | 54 | catch (Exception e) |
55 | { | 55 | { |
56 | db.Close(); | 56 | db.Close(); |
57 | MainLog.Instance.Warn("SQLiteLocalStorage :Constructor - Exception occured"); | 57 | MainLog.Instance.Warn("SQLiteLocalStorage :Constructor - Exception occured"); |
58 | MainLog.Instance.Warn(e.ToString()); | 58 | MainLog.Instance.Warn(e.ToString()); |
59 | } | 59 | } |
60 | } | 60 | } |
61 | 61 | ||
62 | public void Initialise(string file) | 62 | public void Initialise(string file) |
63 | { | 63 | { |
64 | // Blank | 64 | // Blank |
65 | } | 65 | } |
66 | 66 | ||
67 | public void StorePrim(PrimData prim) | 67 | public void StorePrim(PrimData prim) |
68 | { | 68 | { |
69 | IDbCommand cmd = db.CreateCommand(); | 69 | IDbCommand cmd = db.CreateCommand(); |
70 | 70 | ||
71 | //SECURITY WARNING: | 71 | //SECURITY WARNING: |
72 | // These parameters wont produce SQL injections since they are all integer based, however. | 72 | // These parameters wont produce SQL injections since they are all integer based, however. |
73 | // if inserting strings such as name or description, you will need to use appropriate | 73 | // if inserting strings such as name or description, you will need to use appropriate |
74 | // measures to prevent SQL injection (although the value of SQL injection in this is limited). | 74 | // measures to prevent SQL injection (although the value of SQL injection in this is limited). |
75 | 75 | ||
76 | string sql = "REPLACE INTO prim (OwnerID,PCode,PathBegin,PathEnd,PathScaleX,PathScaleY,PathShearX,PathShearY,PathSkew,ProfileBegin,ProfileEnd,Scale,PathCurve,ProfileCurve,ParentID,ProfileHollow,PathRadiusOffset,PathRevolutions,PathTaperX,PathTaperY,PathTwist,PathTwistBegin,Texture,CreationDate,OwnerMask,NextOwnerMask,GroupMask,EveryoneMask,BaseMask,Position,Rotation,LocalID,FullID) "; | 76 | string sql = "REPLACE INTO prim (OwnerID,PCode,PathBegin,PathEnd,PathScaleX,PathScaleY,PathShearX,PathShearY,PathSkew,ProfileBegin,ProfileEnd,Scale,PathCurve,ProfileCurve,ParentID,ProfileHollow,PathRadiusOffset,PathRevolutions,PathTaperX,PathTaperY,PathTwist,PathTwistBegin,Texture,CreationDate,OwnerMask,NextOwnerMask,GroupMask,EveryoneMask,BaseMask,Position,Rotation,LocalID,FullID) "; |
77 | sql += "VALUES ("; | 77 | sql += "VALUES ("; |
78 | sql += "\"" + prim.OwnerID.ToStringHyphenated() + "\","; // KILL ME NOW! | 78 | sql += "\"" + prim.OwnerID.ToStringHyphenated() + "\","; // KILL ME NOW! |
79 | sql += "\"" + prim.PCode.ToString() + "\","; | 79 | sql += "\"" + prim.PCode.ToString() + "\","; |
80 | sql += "\"" + prim.PathBegin.ToString() + "\","; | 80 | sql += "\"" + prim.PathBegin.ToString() + "\","; |
81 | sql += "\"" + prim.PathEnd.ToString() + "\","; | 81 | sql += "\"" + prim.PathEnd.ToString() + "\","; |
82 | sql += "\"" + prim.PathScaleX.ToString() + "\","; | 82 | sql += "\"" + prim.PathScaleX.ToString() + "\","; |
83 | sql += "\"" + prim.PathScaleY.ToString() + "\","; | 83 | sql += "\"" + prim.PathScaleY.ToString() + "\","; |
84 | sql += "\"" + prim.PathShearX.ToString() + "\","; | 84 | sql += "\"" + prim.PathShearX.ToString() + "\","; |
85 | sql += "\"" + prim.PathShearY.ToString() + "\","; | 85 | sql += "\"" + prim.PathShearY.ToString() + "\","; |
86 | sql += "\"" + prim.PathSkew.ToString() + "\","; | 86 | sql += "\"" + prim.PathSkew.ToString() + "\","; |
87 | sql += "\"" + prim.ProfileBegin.ToString() + "\","; | 87 | sql += "\"" + prim.ProfileBegin.ToString() + "\","; |
88 | sql += "\"" + prim.ProfileEnd.ToString() + "\","; | 88 | sql += "\"" + prim.ProfileEnd.ToString() + "\","; |
89 | sql += "\"" + prim.Scale.ToString() + "\","; | 89 | sql += "\"" + prim.Scale.ToString() + "\","; |
90 | sql += "\"" + prim.PathCurve.ToString() + "\","; | 90 | sql += "\"" + prim.PathCurve.ToString() + "\","; |
91 | sql += "\"" + prim.ProfileCurve.ToString() + "\","; | 91 | sql += "\"" + prim.ProfileCurve.ToString() + "\","; |
92 | sql += "\"" + prim.ParentID.ToString() + "\","; | 92 | sql += "\"" + prim.ParentID.ToString() + "\","; |
93 | sql += "\"" + prim.ProfileHollow.ToString() + "\","; | 93 | sql += "\"" + prim.ProfileHollow.ToString() + "\","; |
94 | sql += "\"" + prim.PathRadiusOffset.ToString() + "\","; | 94 | sql += "\"" + prim.PathRadiusOffset.ToString() + "\","; |
95 | sql += "\"" + prim.PathRevolutions.ToString() + "\","; | 95 | sql += "\"" + prim.PathRevolutions.ToString() + "\","; |
96 | sql += "\"" + prim.PathTaperX.ToString() + "\","; | 96 | sql += "\"" + prim.PathTaperX.ToString() + "\","; |
97 | sql += "\"" + prim.PathTaperY.ToString() + "\","; | 97 | sql += "\"" + prim.PathTaperY.ToString() + "\","; |
98 | sql += "\"" + prim.PathTwist.ToString() + "\","; | 98 | sql += "\"" + prim.PathTwist.ToString() + "\","; |
99 | sql += "\"" + prim.PathTwistBegin.ToString() + "\","; | 99 | sql += "\"" + prim.PathTwistBegin.ToString() + "\","; |
100 | sql += "\"" + prim.TextureEntry.ToString() + "\","; | 100 | sql += "\"" + prim.TextureEntry.ToString() + "\","; |
101 | sql += "\"" + prim.CreationDate.ToString() + "\","; | 101 | sql += "\"" + prim.CreationDate.ToString() + "\","; |
102 | sql += "\"" + prim.OwnerMask.ToString() + "\","; | 102 | sql += "\"" + prim.OwnerMask.ToString() + "\","; |
103 | sql += "\"" + prim.NextOwnerMask.ToString() + "\","; | 103 | sql += "\"" + prim.NextOwnerMask.ToString() + "\","; |
104 | sql += "\"" + prim.GroupMask.ToString() + "\","; | 104 | sql += "\"" + prim.GroupMask.ToString() + "\","; |
105 | sql += "\"" + prim.EveryoneMask.ToString() + "\","; | 105 | sql += "\"" + prim.EveryoneMask.ToString() + "\","; |
106 | sql += "\"" + prim.BaseMask.ToString() + "\","; | 106 | sql += "\"" + prim.BaseMask.ToString() + "\","; |
107 | sql += "\"" + prim.Position.ToString() + "\","; | 107 | sql += "\"" + prim.Position.ToString() + "\","; |
108 | sql += "\"" + prim.Rotation.ToString() + "\","; | 108 | sql += "\"" + prim.Rotation.ToString() + "\","; |
109 | sql += "\"" + prim.LocalID.ToString() + "\","; | 109 | sql += "\"" + prim.LocalID.ToString() + "\","; |
110 | sql += "\"" + prim.FullID.ToString() + "\")"; | 110 | sql += "\"" + prim.FullID.ToString() + "\")"; |
111 | 111 | ||
112 | cmd.CommandText = sql; | 112 | cmd.CommandText = sql; |
113 | 113 | ||
114 | try | 114 | try |
115 | { | 115 | { |
116 | cmd.ExecuteNonQuery(); | 116 | cmd.ExecuteNonQuery(); |
117 | } | 117 | } |
118 | catch (Exception e) | 118 | catch (Exception e) |
119 | { | 119 | { |
120 | MainLog.Instance.Warn("SQLiteLocalStorage :StorePrim - Exception occured"); | 120 | MainLog.Instance.Warn("SQLiteLocalStorage :StorePrim - Exception occured"); |
121 | MainLog.Instance.Warn(e.ToString()); | 121 | MainLog.Instance.Warn(e.ToString()); |
122 | } | 122 | } |
123 | 123 | ||
124 | cmd.Dispose(); | 124 | cmd.Dispose(); |
125 | cmd = null; | 125 | cmd = null; |
126 | } | 126 | } |
127 | 127 | ||
128 | public void RemovePrim(LLUUID primID) | 128 | public void RemovePrim(LLUUID primID) |
129 | { | 129 | { |
130 | IDbCommand cmd = db.CreateCommand(); | 130 | IDbCommand cmd = db.CreateCommand(); |
131 | 131 | ||
132 | //SECURITY WARNING: | 132 | //SECURITY WARNING: |
133 | // These parameters wont produce SQL injections since they are all integer based, however. | 133 | // These parameters wont produce SQL injections since they are all integer based, however. |
134 | // if inserting strings such as name or description, you will need to use appropriate | 134 | // if inserting strings such as name or description, you will need to use appropriate |
135 | // measures to prevent SQL injection (although the value of SQL injection in this is limited). | 135 | // measures to prevent SQL injection (although the value of SQL injection in this is limited). |
136 | 136 | ||
137 | string sql = "DELETE FROM prim WHERE FullID = \"" + primID.ToStringHyphenated() + "\""; | 137 | string sql = "DELETE FROM prim WHERE FullID = \"" + primID.ToStringHyphenated() + "\""; |
138 | 138 | ||
139 | cmd.CommandText = sql; | 139 | cmd.CommandText = sql; |
140 | 140 | ||
141 | try | 141 | try |
142 | { | 142 | { |
143 | cmd.ExecuteNonQuery(); | 143 | cmd.ExecuteNonQuery(); |
144 | } | 144 | } |
145 | catch (Exception e) | 145 | catch (Exception e) |
146 | { | 146 | { |
147 | MainLog.Instance.Warn("SQLiteLocalStorage :RemovePrim - Exception occured"); | 147 | MainLog.Instance.Warn("SQLiteLocalStorage :RemovePrim - Exception occured"); |
148 | MainLog.Instance.Warn(e.ToString()); | 148 | MainLog.Instance.Warn(e.ToString()); |
149 | } | 149 | } |
150 | 150 | ||
151 | cmd.Dispose(); | 151 | cmd.Dispose(); |
152 | cmd = null; | 152 | cmd = null; |
153 | } | 153 | } |
154 | 154 | ||
155 | public void LoadPrimitives(ILocalStorageReceiver receiver) | 155 | public void LoadPrimitives(ILocalStorageReceiver receiver) |
156 | { | 156 | { |
157 | 157 | ||
158 | } | 158 | } |
159 | 159 | ||
160 | public float[] LoadWorld() | 160 | public float[] LoadWorld() |
161 | { | 161 | { |
162 | return new float[65536]; | 162 | return new float[65536]; |
163 | } | 163 | } |
164 | 164 | ||
165 | public void SaveMap(float[] heightmap) | 165 | public void SaveMap(float[] heightmap) |
166 | { | 166 | { |
167 | 167 | ||
168 | } | 168 | } |
169 | 169 | ||
170 | public void SaveParcels(ParcelData[] parcel_manager) | 170 | public void SaveParcels(ParcelData[] parcel_manager) |
171 | { | 171 | { |
172 | 172 | ||
173 | } | 173 | } |
174 | 174 | ||
175 | public void SaveParcel(ParcelData parcel) | 175 | public void SaveParcel(ParcelData parcel) |
176 | { | 176 | { |
177 | } | 177 | } |
178 | 178 | ||
179 | public void RemoveParcel(ParcelData parcel) | 179 | public void RemoveParcel(ParcelData parcel) |
180 | { | 180 | { |
181 | } | 181 | } |
182 | 182 | ||
183 | public void RemoveAllParcels() | 183 | public void RemoveAllParcels() |
184 | { | 184 | { |
185 | } | 185 | } |
186 | 186 | ||
187 | public void LoadParcels(ILocalStorageParcelReceiver recv) | 187 | public void LoadParcels(ILocalStorageParcelReceiver recv) |
188 | { | 188 | { |
189 | recv.NoParcelDataFromStorage(); | 189 | recv.NoParcelDataFromStorage(); |
190 | } | 190 | } |
191 | 191 | ||
192 | public void ShutDown() | 192 | public void ShutDown() |
193 | { | 193 | { |
194 | db.Close(); | 194 | db.Close(); |
195 | db = null; | 195 | db = null; |
196 | } | 196 | } |
197 | } | 197 | } |
198 | } \ No newline at end of file | 198 | } \ No newline at end of file |
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/NullDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/NullDataStore.cs index 7c8bd07..3ce0967 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/NullDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/NullDataStore.cs | |||
@@ -1,65 +1,66 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | 4 | ||
5 | using OpenSim.Region.Environment.Scenes; | 5 | using OpenSim.Region.Environment.Scenes; |
6 | using OpenSim.Region.Environment; | 6 | using OpenSim.Region.Environment; |
7 | using OpenSim.Region.Interfaces; | 7 | using OpenSim.Region.Interfaces; |
8 | using OpenSim.Framework.Console; | 8 | using OpenSim.Framework.Console; |
9 | using libsecondlife; | 9 | using libsecondlife; |
10 | 10 | ||
11 | namespace OpenSim.DataStore.NullStorage | 11 | namespace OpenSim.DataStore.NullStorage |
12 | { | 12 | { |
13 | public class NullDataStore : IRegionDataStore | 13 | public class NullDataStore : IRegionDataStore |
14 | { | 14 | { |
15 | public void Initialise(string dbfile, string dbname) | 15 | |
16 | { | 16 | public void Initialise(string dbfile, string dbname) |
17 | return; | 17 | { |
18 | } | 18 | return; |
19 | 19 | } | |
20 | public void StoreObject(SceneObject obj) | 20 | |
21 | { | 21 | public void StoreObject(SceneObject obj) |
22 | 22 | { | |
23 | } | 23 | |
24 | 24 | } | |
25 | public void RemoveObject(LLUUID obj) | 25 | |
26 | { | 26 | public void RemoveObject(LLUUID obj) |
27 | 27 | { | |
28 | } | 28 | |
29 | 29 | } | |
30 | public List<SceneObject> LoadObjects() | 30 | |
31 | { | 31 | public List<SceneObject> LoadObjects() |
32 | return new List<SceneObject>(); | 32 | { |
33 | } | 33 | return new List<SceneObject>(); |
34 | 34 | } | |
35 | public void StoreTerrain(double[,] ter) | 35 | |
36 | { | 36 | public void StoreTerrain(double[,] ter) |
37 | 37 | { | |
38 | } | 38 | |
39 | 39 | } | |
40 | public double[,] LoadTerrain() | 40 | |
41 | { | 41 | public double[,] LoadTerrain() |
42 | return null; | 42 | { |
43 | } | 43 | return null; |
44 | 44 | } | |
45 | public void RemoveParcel(uint id) | 45 | |
46 | { | 46 | public void RemoveParcel(uint id) |
47 | 47 | { | |
48 | } | 48 | |
49 | 49 | } | |
50 | public void StoreParcel(OpenSim.Region.Environment.Parcel parcel) | 50 | |
51 | { | 51 | public void StoreParcel(OpenSim.Region.Environment.Parcel parcel) |
52 | 52 | { | |
53 | } | 53 | |
54 | 54 | } | |
55 | public List<OpenSim.Region.Environment.Parcel> LoadParcels() | 55 | |
56 | { | 56 | public List<OpenSim.Region.Environment.Parcel> LoadParcels() |
57 | return new List<OpenSim.Region.Environment.Parcel>(); | 57 | { |
58 | } | 58 | return new List<OpenSim.Region.Environment.Parcel>(); |
59 | 59 | } | |
60 | public void Shutdown() | 60 | |
61 | { | 61 | public void Shutdown() |
62 | 62 | { | |
63 | } | 63 | |
64 | } | 64 | } |
65 | } | 65 | } |
66 | } | ||
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/Properties/AssemblyInfo.cs b/OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/Properties/AssemblyInfo.cs index c0bd46d..fd86315 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/Properties/AssemblyInfo.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.NullStorage/Properties/AssemblyInfo.cs | |||
@@ -1,35 +1,35 @@ | |||
1 | using System.Reflection; | 1 | using System.Reflection; |
2 | using System.Runtime.CompilerServices; | 2 | using System.Runtime.CompilerServices; |
3 | using System.Runtime.InteropServices; | 3 | using System.Runtime.InteropServices; |
4 | 4 | ||
5 | // General Information about an assembly is controlled through the following | 5 | // General Information about an assembly is controlled through the following |
6 | // set of attributes. Change these attribute values to modify the information | 6 | // set of attributes. Change these attribute values to modify the information |
7 | // associated with an assembly. | 7 | // associated with an assembly. |
8 | [assembly: AssemblyTitle("OpenSim.DataStore.NullStorage")] | 8 | [assembly: AssemblyTitle("OpenSim.DataStore.NullStorage")] |
9 | [assembly: AssemblyDescription("")] | 9 | [assembly: AssemblyDescription("")] |
10 | [assembly: AssemblyConfiguration("")] | 10 | [assembly: AssemblyConfiguration("")] |
11 | [assembly: AssemblyCompany("")] | 11 | [assembly: AssemblyCompany("")] |
12 | [assembly: AssemblyProduct("OpenSim.DataStore.NullStorage")] | 12 | [assembly: AssemblyProduct("OpenSim.DataStore.NullStorage")] |
13 | [assembly: AssemblyCopyright("Copyright © 2007")] | 13 | [assembly: AssemblyCopyright("Copyright © 2007")] |
14 | [assembly: AssemblyTrademark("")] | 14 | [assembly: AssemblyTrademark("")] |
15 | [assembly: AssemblyCulture("")] | 15 | [assembly: AssemblyCulture("")] |
16 | 16 | ||
17 | // Setting ComVisible to false makes the types in this assembly not visible | 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 | 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. | 19 | // COM, set the ComVisible attribute to true on that type. |
20 | [assembly: ComVisible(false)] | 20 | [assembly: ComVisible(false)] |
21 | 21 | ||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM |
23 | [assembly: Guid("b4a1656d-de22-4080-a970-fd8166acbf16")] | 23 | [assembly: Guid("b4a1656d-de22-4080-a970-fd8166acbf16")] |
24 | 24 | ||
25 | // Version information for an assembly consists of the following four values: | 25 | // Version information for an assembly consists of the following four values: |
26 | // | 26 | // |
27 | // Major Version | 27 | // Major Version |
28 | // Minor Version | 28 | // Minor Version |
29 | // Build Number | 29 | // Build Number |
30 | // Revision | 30 | // Revision |
31 | // | 31 | // |
32 | // You can specify all the values or you can default the Revision and Build Numbers | 32 | // You can specify all the values or you can default the Revision and Build Numbers |
33 | // by using the '*' as shown below: | 33 | // by using the '*' as shown below: |
34 | [assembly: AssemblyVersion("1.0.0.0")] | 34 | [assembly: AssemblyVersion("1.0.0.0")] |
35 | [assembly: AssemblyFileVersion("1.0.0.0")] | 35 | [assembly: AssemblyFileVersion("1.0.0.0")] |