diff options
author | Sean Dague | 2007-07-16 15:40:11 +0000 |
---|---|---|
committer | Sean Dague | 2007-07-16 15:40:11 +0000 |
commit | 2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6 (patch) | |
tree | e3f80ad51736cf17e856547b1bcf956010927434 /OpenSim/Region/Storage/LocalStorageBerkeleyDB | |
parent | *Trunk compiles now (diff) | |
download | opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.zip opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.gz opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.bz2 opensim-SC_OLD-2a3c79df83e800d5dfe75a1a3b140ed81da2b1d6.tar.xz |
changed to native line ending encoding
Diffstat (limited to 'OpenSim/Region/Storage/LocalStorageBerkeleyDB')
-rw-r--r-- | OpenSim/Region/Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs | 222 |
1 files changed, 111 insertions, 111 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 |