aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMW2007-03-08 18:07:53 +0000
committerMW2007-03-08 18:07:53 +0000
commitaa120266d79b87b39bf80f3f7aaca8970447bde1 (patch)
treececae22f2d8b2fc7541a011d2db86f819901c51f
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 '')
-rw-r--r--src/Config.cs2
-rw-r--r--src/Config/SimConfig/Db4SimConfig.cs14
-rw-r--r--src/GridInterfaces/ILocalStorage.cs31
-rw-r--r--src/LocalStorage/Db4LocalStorage/Db4LocalStorage.cs34
-rw-r--r--src/OpenSimClient.cs31
-rw-r--r--src/OpenSimConsole.cs31
-rw-r--r--src/world/Primitive.cs101
-rw-r--r--src/world/World.cs15
8 files changed, 211 insertions, 48 deletions
diff --git a/src/Config.cs b/src/Config.cs
index c42b80e..c7cd3cd 100644
--- a/src/Config.cs
+++ b/src/Config.cs
@@ -63,6 +63,8 @@ namespace OpenSim
63 public abstract void InitConfig(); 63 public abstract void InitConfig();
64 public abstract void LoadFromGrid(); 64 public abstract void LoadFromGrid();
65 public abstract World LoadWorld(); 65 public abstract World LoadWorld();
66 public abstract void SaveMap();
67
66 } 68 }
67 69
68 public interface ISimConfig 70 public interface ISimConfig
diff --git a/src/Config/SimConfig/Db4SimConfig.cs b/src/Config/SimConfig/Db4SimConfig.cs
index 4a06187..fc2c019 100644
--- a/src/Config/SimConfig/Db4SimConfig.cs
+++ b/src/Config/SimConfig/Db4SimConfig.cs
@@ -128,6 +128,20 @@ namespace Db40SimConfig
128 } 128 }
129 return blank; 129 return blank;
130 } 130 }
131
132 public override void SaveMap()
133 {
134 IObjectSet world_result = db.Get(typeof(MapStorage));
135 if(world_result.Count>0) {
136 ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadWorld() - updating saved copy of heightmap in local database");
137 MapStorage map=(MapStorage)world_result.Next();
138 db.Delete(map);
139 }
140 MapStorage map1= new MapStorage();
141 map1.Map = OpenSim_Main.local_world.LandMap;
142 db.Set(map1);
143 db.Commit();
144 }
131 145
132 public override void LoadFromGrid() { 146 public override void LoadFromGrid() {
133 ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadFromGrid() - dummy function, DOING ABSOLUTELY NOTHING AT ALL!!!"); 147 ServerConsole.MainConsole.Instance.WriteLine("Config.cs:LoadFromGrid() - dummy function, DOING ABSOLUTELY NOTHING AT ALL!!!");
diff --git a/src/GridInterfaces/ILocalStorage.cs b/src/GridInterfaces/ILocalStorage.cs
index 5d6b9b1..6b7ded6 100644
--- a/src/GridInterfaces/ILocalStorage.cs
+++ b/src/GridInterfaces/ILocalStorage.cs
@@ -35,7 +35,7 @@ namespace GridInterfaces
35 /// </summary> 35 /// </summary>
36 public interface ILocalStorage 36 public interface ILocalStorage
37 { 37 {
38 void StorePrim(PrimStorage prim); 38 void StorePrim(PrimData prim);
39 void RemovePrim(LLUUID primID); 39 void RemovePrim(LLUUID primID);
40 void LoadPrimitives(ILocalStorageReceiver receiver); 40 void LoadPrimitives(ILocalStorageReceiver receiver);
41 void ShutDown(); 41 void ShutDown();
@@ -43,23 +43,10 @@ namespace GridInterfaces
43 43
44 public interface ILocalStorageReceiver 44 public interface ILocalStorageReceiver
45 { 45 {
46 void PrimFromStorage(PrimStorage prim); 46 void PrimFromStorage(PrimData prim);
47 } 47 }
48 48
49 public class PrimStorage 49
50 {
51 public PrimData Data;
52 public LLVector3 Position;
53 public LLQuaternion Rotation;
54 public uint LocalID;
55 public LLUUID FullID;
56
57 public PrimStorage()
58 {
59
60 }
61
62 }
63 public class PrimData 50 public class PrimData
64 { 51 {
65 public LLUUID OwnerID; 52 public LLUUID OwnerID;
@@ -78,6 +65,18 @@ namespace GridInterfaces
78 public byte ProfileCurve; 65 public byte ProfileCurve;
79 public uint ParentID=0; 66 public uint ParentID=0;
80 public byte ProfileHollow; 67 public byte ProfileHollow;
68 public sbyte PathRadiusOffset;
69 public byte PathRevolutions;
70 public sbyte PathTaperX;
71 public sbyte PathTaperY;
72 public sbyte PathTwist;
73 public sbyte PathTwistBegin;
74
75 //following only used during prim storage
76 public LLVector3 Position;
77 public LLQuaternion Rotation;
78 public uint LocalID;
79 public LLUUID FullID;
81 80
82 public PrimData() 81 public PrimData()
83 { 82 {
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 }
diff --git a/src/OpenSimClient.cs b/src/OpenSimClient.cs
index 1f9c70c..eb190e9 100644
--- a/src/OpenSimClient.cs
+++ b/src/OpenSimClient.cs
@@ -104,6 +104,25 @@ namespace OpenSim
104 case PacketType.ObjectAdd: 104 case PacketType.ObjectAdd:
105 OpenSim_Main.local_world.AddNewPrim((ObjectAddPacket)Pack, this); 105 OpenSim_Main.local_world.AddNewPrim((ObjectAddPacket)Pack, this);
106 break; 106 break;
107 case PacketType.ObjectLink:
108 ServerConsole.MainConsole.Instance.WriteLine(Pack.ToString());
109 break;
110 case PacketType.ObjectScale:
111 ServerConsole.MainConsole.Instance.WriteLine(Pack.ToString());
112 break;
113 case PacketType.ObjectShape:
114 ObjectShapePacket shape = (ObjectShapePacket)Pack;
115 for(int i =0; i <shape.ObjectData.Length; i++)
116 {
117 foreach (Entity ent in OpenSim_Main.local_world.Entities.Values)
118 {
119 if(ent.localid == shape.ObjectData[i].ObjectLocalID)
120 {
121 ((OpenSim.world.Primitive)ent).UpdateShape(shape.ObjectData[i]);
122 }
123 }
124 }
125 break;
107 case PacketType.MultipleObjectUpdate : 126 case PacketType.MultipleObjectUpdate :
108 MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)Pack; 127 MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)Pack;
109 128
@@ -135,6 +154,18 @@ namespace OpenSim
135 } 154 }
136 } 155 }
137 } 156 }
157 else if(multipleupdate.ObjectData[i].Type == 13 )//scale
158 {
159
160 libsecondlife.LLVector3 scale = new LLVector3(multipleupdate.ObjectData[ i ].Data, 12 );
161 foreach (Entity ent in OpenSim_Main.local_world.Entities.Values)
162 {
163 if(ent.localid == multipleupdate.ObjectData[ i ].ObjectLocalID)
164 {
165 ((OpenSim.world.Primitive)ent).Scale = scale;
166 }
167 }
168 }
138 } 169 }
139 break; 170 break;
140 case PacketType.TransferRequest: 171 case PacketType.TransferRequest:
diff --git a/src/OpenSimConsole.cs b/src/OpenSimConsole.cs
index 80f36af..11bc648 100644
--- a/src/OpenSimConsole.cs
+++ b/src/OpenSimConsole.cs
@@ -145,12 +145,17 @@ namespace OpenSim
145 case "help": 145 case "help":
146 this.WriteLine("show users - show info about connected users"); 146 this.WriteLine("show users - show info about connected users");
147 this.WriteLine("shutdown - disconnect all clients and shutdown"); 147 this.WriteLine("shutdown - disconnect all clients and shutdown");
148 this.WriteLine("regenerate - regenerate the sim's terrain");
148 break; 149 break;
149 150
150 case "show": 151 case "show":
151 ShowCommands(cmdparams[0]); 152 ShowCommands(cmdparams[0]);
152 break; 153 break;
153 154
155 case "regenerate":
156 OpenSim_Main.local_world.RegenerateTerrain();
157 break;
158
154 case "shutdown": 159 case "shutdown":
155 OpenSim_Main.Shutdown(); 160 OpenSim_Main.Shutdown();
156 break; 161 break;
@@ -161,21 +166,21 @@ namespace OpenSim
161 // Shows data about something 166 // Shows data about something
162 public override void ShowCommands(string ShowWhat) { 167 public override void ShowCommands(string ShowWhat) {
163 switch(ShowWhat) { 168 switch(ShowWhat) {
164 case "uptime": 169 case "uptime":
165 this.WriteLine("OpenSim has been running since " + OpenSim_Main.sim.startuptime.ToString()); 170 this.WriteLine("OpenSim has been running since " + OpenSim_Main.sim.startuptime.ToString());
166 this.WriteLine("That is " + (DateTime.Now-OpenSim_Main.sim.startuptime).ToString()); 171 this.WriteLine("That is " + (DateTime.Now-OpenSim_Main.sim.startuptime).ToString());
167 break; 172 break;
168 case "users": 173 case "users":
169 OpenSim.world.Avatar TempAv; 174 OpenSim.world.Avatar TempAv;
170 this.WriteLine(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}","Firstname", "Lastname","Agent ID", "Session ID", "Circuit", "IP")); 175 this.WriteLine(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}","Firstname", "Lastname","Agent ID", "Session ID", "Circuit", "IP"));
171 foreach (libsecondlife.LLUUID UUID in OpenSim_Main.local_world.Entities.Keys) { 176 foreach (libsecondlife.LLUUID UUID in OpenSim_Main.local_world.Entities.Keys) {
172 if(OpenSim_Main.local_world.Entities[UUID].ToString()== "OpenSim.world.Avatar") 177 if(OpenSim_Main.local_world.Entities[UUID].ToString()== "OpenSim.world.Avatar")
173 { 178 {
174 TempAv=(OpenSim.world.Avatar)OpenSim_Main.local_world.Entities[UUID]; 179 TempAv=(OpenSim.world.Avatar)OpenSim_Main.local_world.Entities[UUID];
175 this.WriteLine(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}",TempAv.firstname, TempAv.lastname,UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString())); 180 this.WriteLine(String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}",TempAv.firstname, TempAv.lastname,UUID, TempAv.ControllingClient.SessionID, TempAv.ControllingClient.CircuitCode, TempAv.ControllingClient.userEP.ToString()));
181 }
176 } 182 }
177 } 183 break;
178 break;
179 } 184 }
180 } 185 }
181 186
diff --git a/src/world/Primitive.cs b/src/world/Primitive.cs
index 6029f76..0d7d951 100644
--- a/src/world/Primitive.cs
+++ b/src/world/Primitive.cs
@@ -15,6 +15,7 @@ namespace OpenSim.world
15 protected PrimData primData; 15 protected PrimData primData;
16 protected bool newPrimFlag; 16 protected bool newPrimFlag;
17 protected bool updateFlag; 17 protected bool updateFlag;
18 protected bool dirtyFlag;
18 protected ObjectUpdatePacket OurPacket; 19 protected ObjectUpdatePacket OurPacket;
19 20
20 public bool UpdateFlag 21 public bool UpdateFlag
@@ -28,7 +29,18 @@ namespace OpenSim.world
28 updateFlag = value; 29 updateFlag = value;
29 } 30 }
30 } 31 }
31 32 public LLVector3 Scale
33 {
34 set
35 {
36 this.primData.Scale = value;
37 this.dirtyFlag = true;
38 }
39 get
40 {
41 return this.primData.Scale;
42 }
43 }
32 public Primitive() 44 public Primitive()
33 { 45 {
34 mesh_cutbegin = 0.0f; 46 mesh_cutbegin = 0.0f;
@@ -70,6 +82,13 @@ namespace OpenSim.world
70 } 82 }
71 this.updateFlag = false; 83 this.updateFlag = false;
72 } 84 }
85 else if(this.dirtyFlag)
86 {
87 foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) {
88 UpdateClient(client);
89 }
90 this.dirtyFlag = false;
91 }
73 92
74 } 93 }
75 94
@@ -77,9 +96,58 @@ namespace OpenSim.world
77 { 96 {
78 byte[] pb = this.position.GetBytes(); 97 byte[] pb = this.position.GetBytes();
79 Array.Copy(pb, 0, OurPacket.ObjectData[0].ObjectData, 0, pb.Length); 98 Array.Copy(pb, 0, OurPacket.ObjectData[0].ObjectData, 0, pb.Length);
99 OurPacket.ObjectData[0].OwnerID = this.primData.OwnerID;
100 OurPacket.ObjectData[0].PCode = this.primData.PCode;
101 OurPacket.ObjectData[0].PathBegin = this.primData.PathBegin;
102 OurPacket.ObjectData[0].PathEnd = this.primData.PathEnd;
103 OurPacket.ObjectData[0].PathScaleX = this.primData.PathScaleX;
104 OurPacket.ObjectData[0].PathScaleY = this.primData.PathScaleY;
105 OurPacket.ObjectData[0].PathShearX = this.primData.PathShearX;
106 OurPacket.ObjectData[0].PathShearY = this.primData.PathShearY;
107 OurPacket.ObjectData[0].PathSkew = this.primData.PathSkew;
108 OurPacket.ObjectData[0].ProfileBegin = this.primData.ProfileBegin;
109 OurPacket.ObjectData[0].ProfileEnd = this.primData.ProfileEnd;
110 OurPacket.ObjectData[0].Scale = this.primData.Scale;
111 OurPacket.ObjectData[0].PathCurve = this.primData.PathCurve;
112 OurPacket.ObjectData[0].ProfileCurve = this.primData.ProfileCurve;
113 OurPacket.ObjectData[0].ParentID = 0;
114 OurPacket.ObjectData[0].ProfileHollow = this.primData.ProfileHollow;
115 //finish off copying rest of shape data
116 OurPacket.ObjectData[0].PathRadiusOffset = this.primData.PathRadiusOffset;
117 OurPacket.ObjectData[0].PathRevolutions = this.primData.PathRevolutions;
118 OurPacket.ObjectData[0].PathTaperX = this.primData.PathTaperX;
119 OurPacket.ObjectData[0].PathTaperY = this.primData.PathTaperY;
120 OurPacket.ObjectData[0].PathTwist = this.primData.PathTwist;
121 OurPacket.ObjectData[0].PathTwistBegin= this.primData.PathTwistBegin;
122
80 RemoteClient.OutPacket(OurPacket); 123 RemoteClient.OutPacket(OurPacket);
81 } 124 }
82 125
126 public void UpdateShape(ObjectShapePacket.ObjectDataBlock addPacket)
127 {
128 this.primData.PathBegin = addPacket.PathBegin;
129 this.primData.PathEnd = addPacket.PathEnd;
130 this.primData.PathScaleX = addPacket.PathScaleX;
131 this.primData.PathScaleY = addPacket.PathScaleY;
132 this.primData.PathShearX = addPacket.PathShearX;
133 this.primData.PathShearY = addPacket.PathShearY;
134 this.primData.PathSkew = addPacket.PathSkew;
135 this.primData.ProfileBegin = addPacket.ProfileBegin;
136 this.primData.ProfileEnd = addPacket.ProfileEnd;
137 this.primData.PathCurve = addPacket.PathCurve;
138 this.primData.ProfileCurve = addPacket.ProfileCurve;
139 this.primData.ProfileHollow = addPacket.ProfileHollow;
140
141 this.primData.PathRadiusOffset = addPacket.PathRadiusOffset;
142 this.primData.PathRevolutions = addPacket.PathRevolutions;
143 this.primData.PathTaperX = addPacket.PathTaperX;
144 this.primData.PathTaperY = addPacket.PathTaperY;
145 this.primData.PathTwist = addPacket.PathTwist;
146 this.primData.PathTwistBegin =addPacket.PathTwistBegin;
147 this.dirtyFlag = true;
148
149 }
150
83 public void CreateFromPacket( ObjectAddPacket addPacket, LLUUID agentID, uint localID) 151 public void CreateFromPacket( ObjectAddPacket addPacket, LLUUID agentID, uint localID)
84 { 152 {
85 ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); 153 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
@@ -124,6 +192,13 @@ namespace OpenSim.world
124 PData.ParentID = objupdate.ObjectData[0].ParentID = 0; 192 PData.ParentID = objupdate.ObjectData[0].ParentID = 0;
125 PData.ProfileHollow = objupdate.ObjectData[0].ProfileHollow = addPacket.ObjectData.ProfileHollow; 193 PData.ProfileHollow = objupdate.ObjectData[0].ProfileHollow = addPacket.ObjectData.ProfileHollow;
126 194
195 PData.PathRadiusOffset = objupdate.ObjectData[0].PathRadiusOffset = addPacket.ObjectData.PathRadiusOffset;
196 PData.PathRevolutions = objupdate.ObjectData[0].PathRevolutions = addPacket.ObjectData.PathRevolutions;
197 PData.PathTaperX = objupdate.ObjectData[0].PathTaperX = addPacket.ObjectData.PathTaperX;
198 PData.PathTaperY = objupdate.ObjectData[0].PathTaperY = addPacket.ObjectData.PathTaperY;
199 PData.PathTwist = objupdate.ObjectData[0].PathTwist = addPacket.ObjectData.PathTwist;
200 PData.PathTwistBegin = objupdate.ObjectData[0].PathTwistBegin = addPacket.ObjectData.PathTwistBegin;
201
127 //finish off copying rest of shape data 202 //finish off copying rest of shape data
128 203
129 objupdate.ObjectData[0].ID = (uint)(localID); 204 objupdate.ObjectData[0].ID = (uint)(localID);
@@ -143,7 +218,7 @@ namespace OpenSim.world
143 this.OurPacket = objupdate; 218 this.OurPacket = objupdate;
144 } 219 }
145 220
146 public void CreateFromStorage(PrimStorage store) 221 public void CreateFromStorage(PrimData store)
147 { 222 {
148 //need to clean this up as it shares a lot of code with CreateFromPacket() 223 //need to clean this up as it shares a lot of code with CreateFromPacket()
149 ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); 224 ObjectUpdatePacket objupdate = new ObjectUpdatePacket();
@@ -151,7 +226,7 @@ namespace OpenSim.world
151 objupdate.RegionData.TimeDilation = 64096; 226 objupdate.RegionData.TimeDilation = 64096;
152 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1]; 227 objupdate.ObjectData = new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock[1];
153 228
154 this.primData = store.Data; 229 this.primData = store;
155 objupdate.ObjectData[0] = new ObjectUpdatePacket.ObjectDataBlock(); 230 objupdate.ObjectData[0] = new ObjectUpdatePacket.ObjectDataBlock();
156 objupdate.ObjectData[0].PSBlock = new byte[0]; 231 objupdate.ObjectData[0].PSBlock = new byte[0];
157 objupdate.ObjectData[0].ExtraParams = new byte[1]; 232 objupdate.ObjectData[0].ExtraParams = new byte[1];
@@ -187,6 +262,12 @@ namespace OpenSim.world
187 objupdate.ObjectData[0].ParentID = 0; 262 objupdate.ObjectData[0].ParentID = 0;
188 objupdate.ObjectData[0].ProfileHollow = this.primData.ProfileHollow; 263 objupdate.ObjectData[0].ProfileHollow = this.primData.ProfileHollow;
189 //finish off copying rest of shape data 264 //finish off copying rest of shape data
265 objupdate.ObjectData[0].PathRadiusOffset = this.primData.PathRadiusOffset;
266 objupdate.ObjectData[0].PathRevolutions = this.primData.PathRevolutions;
267 objupdate.ObjectData[0].PathTaperX = this.primData.PathTaperX;
268 objupdate.ObjectData[0].PathTaperY = this.primData.PathTaperY;
269 objupdate.ObjectData[0].PathTwist = this.primData.PathTwist;
270 objupdate.ObjectData[0].PathTwistBegin= this.primData.PathTwistBegin;
190 271
191 objupdate.ObjectData[0].ID = (uint)store.LocalID; 272 objupdate.ObjectData[0].ID = (uint)store.LocalID;
192 objupdate.ObjectData[0].FullID = store.FullID; 273 objupdate.ObjectData[0].FullID = store.FullID;
@@ -203,6 +284,7 @@ namespace OpenSim.world
203 this.localid = objupdate.ObjectData[0].ID; 284 this.localid = objupdate.ObjectData[0].ID;
204 this.position = pos1; 285 this.position = pos1;
205 this.OurPacket = objupdate; 286 this.OurPacket = objupdate;
287
206 } 288 }
207 public ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateImprovedBlock() 289 public ImprovedTerseObjectUpdatePacket.ObjectDataBlock CreateImprovedBlock()
208 { 290 {
@@ -272,13 +354,12 @@ namespace OpenSim.world
272 354
273 public override void BackUp() 355 public override void BackUp()
274 { 356 {
275 PrimStorage pStore = new PrimStorage(); 357
276 pStore.Data = this.primData; 358 this.primData.FullID = this.uuid;
277 pStore.FullID = this.uuid; 359 this.primData.LocalID = this.localid;
278 pStore.LocalID = this.localid; 360 this.primData.Position = this.position;
279 pStore.Position = this.position; 361 this.primData.Rotation = new LLQuaternion(this.rotation.x, this.rotation.y, this.rotation.z , this.rotation.w);
280 pStore.Rotation = new LLQuaternion(this.rotation.x, this.rotation.y, this.rotation.z , this.rotation.w); 362 OpenSim_Main.local_world.localStorage.StorePrim(this.primData);
281 OpenSim_Main.local_world.localStorage.StorePrim(pStore);
282 } 363 }
283 } 364 }
284 365
diff --git a/src/world/World.cs b/src/world/World.cs
index 6be9dd2..fb78819 100644
--- a/src/world/World.cs
+++ b/src/world/World.cs
@@ -71,7 +71,7 @@ namespace OpenSim.world
71 71
72 //backup world data 72 //backup world data
73 this.storageCount++; 73 this.storageCount++;
74 if(storageCount> 1200) //set to how often you want to backup (currently set for about every 2 minutes) 74 if(storageCount> 300) //set to how often you want to backup
75 { 75 {
76 this.Backup(); 76 this.Backup();
77 storageCount =0; 77 storageCount =0;
@@ -107,13 +107,24 @@ namespace OpenSim.world
107 return(store == null); 107 return(store == null);
108 } 108 }
109 109
110 public void RegenerateTerrain()
111 {
112 HeightmapGenHills hills = new HeightmapGenHills();
113 this.LandMap = hills.GenerateHeightmap(200, 4.0f, 80.0f, false);
114 this.phyScene.SetTerrain(this.LandMap);
115 OpenSim_Main.cfg.SaveMap();
116
117 foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) {
118 this.SendLayerData(client);
119 }
120 }
110 public void LoadPrimsFromStorage() 121 public void LoadPrimsFromStorage()
111 { 122 {
112 ServerConsole.MainConsole.Instance.WriteLine("World.cs: LoadPrimsFromStorage() - Loading primitives"); 123 ServerConsole.MainConsole.Instance.WriteLine("World.cs: LoadPrimsFromStorage() - Loading primitives");
113 this.localStorage.LoadPrimitives(this); 124 this.localStorage.LoadPrimitives(this);
114 } 125 }
115 126
116 public void PrimFromStorage(PrimStorage prim) 127 public void PrimFromStorage(PrimData prim)
117 { 128 {
118 if(prim.LocalID >= this._primCount) 129 if(prim.LocalID >= this._primCount)
119 { 130 {