aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/LocalStorage
diff options
context:
space:
mode:
authorMW2007-03-08 18:07:53 +0000
committerMW2007-03-08 18:07:53 +0000
commitaa120266d79b87b39bf80f3f7aaca8970447bde1 (patch)
treececae22f2d8b2fc7541a011d2db86f819901c51f /src/LocalStorage
parentChanged water height to default of 20 (diff)
downloadopensim-SC_OLD-aa120266d79b87b39bf80f3f7aaca8970447bde1.zip
opensim-SC_OLD-aa120266d79b87b39bf80f3f7aaca8970447bde1.tar.gz
opensim-SC_OLD-aa120266d79b87b39bf80f3f7aaca8970447bde1.tar.bz2
opensim-SC_OLD-aa120266d79b87b39bf80f3f7aaca8970447bde1.tar.xz
Primitive's shape and scale are now saved into database and reloaded.
New ServerConsole command: regenerate - will regenerate the terrain of the whole sim.
Diffstat (limited to 'src/LocalStorage')
-rw-r--r--src/LocalStorage/Db4LocalStorage/Db4LocalStorage.cs34
1 files changed, 27 insertions, 7 deletions
diff --git a/src/LocalStorage/Db4LocalStorage/Db4LocalStorage.cs b/src/LocalStorage/Db4LocalStorage/Db4LocalStorage.cs
index 9dc81a1..bb9825c 100644
--- a/src/LocalStorage/Db4LocalStorage/Db4LocalStorage.cs
+++ b/src/LocalStorage/Db4LocalStorage/Db4LocalStorage.cs
@@ -55,23 +55,43 @@ namespace Db4LocalStorage
55 } 55 }
56 } 56 }
57 57
58 public void StorePrim(PrimStorage prim) 58 public void StorePrim(PrimData prim)
59 { 59 {
60 IObjectSet result = db.Query(new UUIDQuery(prim.FullID)); 60 IObjectSet result = db.Query(new UUIDQuery(prim.FullID));
61 if(result.Count>0) 61 if(result.Count>0)
62 { 62 {
63 //prim already in storage 63 //prim already in storage
64 //so update it 64 //so update it
65 PrimStorage found = (PrimStorage) result.Next(); 65 PrimData found = (PrimData) result.Next();
66 found.Data = prim.Data; 66 found.PathBegin = prim.PathBegin;
67 found.PathCurve= prim.PathCurve;
68 found.PathEnd = prim.PathEnd;
69 found.PathRadiusOffset = prim.PathRadiusOffset;
70 found.PathRevolutions = prim.PathRevolutions;
71 found.PathScaleX= prim.PathScaleX;
72 found.PathScaleY = prim.PathScaleY;
73 found.PathShearX = prim.PathShearX;
74 found.PathShearY = prim.PathShearY;
75 found.PathSkew = prim.PathSkew;
76 found.PathTaperX = prim.PathTaperX;
77 found.PathTaperY = prim.PathTaperY;
78 found.PathTwist = prim.PathTwist;
79 found.PathTwistBegin = prim.PathTwistBegin;
80 found.PCode = prim.PCode;
81 found.ProfileBegin = prim.ProfileBegin;
82 found.ProfileCurve = prim.ProfileCurve;
83 found.ProfileEnd = prim.ProfileEnd;
84 found.ProfileHollow = prim.ProfileHollow;
67 found.Position = prim.Position; 85 found.Position = prim.Position;
68 found.Rotation = prim.Rotation; 86 found.Rotation = prim.Rotation;
69 db.Set(found); 87 db.Set(found);
88 db.Commit();
70 } 89 }
71 else 90 else
72 { 91 {
73 //not in storage 92 //not in storage
74 db.Set(prim); 93 db.Set(prim);
94 db.Commit();
75 } 95 }
76 } 96 }
77 97
@@ -80,7 +100,7 @@ namespace Db4LocalStorage
80 IObjectSet result = db.Query(new UUIDQuery(primID)); 100 IObjectSet result = db.Query(new UUIDQuery(primID));
81 if(result.Count>0) 101 if(result.Count>0)
82 { 102 {
83 PrimStorage found = (PrimStorage) result.Next(); 103 PrimData found = (PrimData) result.Next();
84 db.Delete(found); 104 db.Delete(found);
85 } 105 }
86 } 106 }
@@ -88,9 +108,9 @@ namespace Db4LocalStorage
88 108
89 public void LoadPrimitives(ILocalStorageReceiver receiver) 109 public void LoadPrimitives(ILocalStorageReceiver receiver)
90 { 110 {
91 IObjectSet result = db.Get(typeof(PrimStorage)); 111 IObjectSet result = db.Get(typeof(PrimData));
92 ServerConsole.MainConsole.Instance.WriteLine("Db4LocalStorage.cs: LoadPrimitives() - number of prims in storages is "+result.Count); 112 ServerConsole.MainConsole.Instance.WriteLine("Db4LocalStorage.cs: LoadPrimitives() - number of prims in storages is "+result.Count);
93 foreach (PrimStorage prim in result) { 113 foreach (PrimData prim in result) {
94 receiver.PrimFromStorage(prim); 114 receiver.PrimFromStorage(prim);
95 } 115 }
96 } 116 }
@@ -110,7 +130,7 @@ namespace Db4LocalStorage
110 { 130 {
111 _findID = find; 131 _findID = find;
112 } 132 }
113 public bool Match(PrimStorage prim) 133 public bool Match(PrimData prim)
114 { 134 {
115 return (prim.FullID == _findID); 135 return (prim.FullID == _findID);
116 } 136 }