diff options
author | MW | 2007-04-03 16:10:00 +0000 |
---|---|---|
committer | MW | 2007-04-03 16:10:00 +0000 |
commit | ba2c94721c2f3b9dc263ad6ca635aa8a9c521ba5 (patch) | |
tree | c8f650dc2492960b1fa234c751a1ac6f76ab650a | |
parent | Temporary fix for the object taking bug (diff) | |
download | opensim-SC-ba2c94721c2f3b9dc263ad6ca635aa8a9c521ba5.zip opensim-SC-ba2c94721c2f3b9dc263ad6ca635aa8a9c521ba5.tar.gz opensim-SC-ba2c94721c2f3b9dc263ad6ca635aa8a9c521ba5.tar.bz2 opensim-SC-ba2c94721c2f3b9dc263ad6ca635aa8a9c521ba5.tar.xz |
Limited (hacked) object linking. Note: once you have linked a set of prims together (in one go), then don't try to link anymore prims to those objects.
-rw-r--r-- | OpenSim.RegionServer/SimClient.cs | 27 | ||||
-rw-r--r-- | OpenSim.RegionServer/world/Primitive.cs | 9 |
2 files changed, 33 insertions, 3 deletions
diff --git a/OpenSim.RegionServer/SimClient.cs b/OpenSim.RegionServer/SimClient.cs index ea70d02..58cc625 100644 --- a/OpenSim.RegionServer/SimClient.cs +++ b/OpenSim.RegionServer/SimClient.cs | |||
@@ -257,6 +257,31 @@ namespace OpenSim | |||
257 | break; | 257 | break; |
258 | case PacketType.ObjectLink: | 258 | case PacketType.ObjectLink: |
259 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(Pack.ToString()); | 259 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(Pack.ToString()); |
260 | ObjectLinkPacket link = (ObjectLinkPacket)Pack; | ||
261 | uint parentprimid = 0; | ||
262 | OpenSim.world.Primitive parentprim = null; | ||
263 | if (link.ObjectData.Length > 1) | ||
264 | { | ||
265 | parentprimid = link.ObjectData[0].ObjectLocalID; | ||
266 | foreach (Entity ent in m_world.Entities.Values) | ||
267 | { | ||
268 | if (ent.localid == parentprimid) | ||
269 | { | ||
270 | parentprim = (OpenSim.world.Primitive)ent; | ||
271 | |||
272 | } | ||
273 | } | ||
274 | for (int i = 1; i < link.ObjectData.Length; i++) | ||
275 | { | ||
276 | foreach (Entity ent in m_world.Entities.Values) | ||
277 | { | ||
278 | if (ent.localid == link.ObjectData[i].ObjectLocalID) | ||
279 | { | ||
280 | ((OpenSim.world.Primitive)ent).MakeParent(parentprim); | ||
281 | } | ||
282 | } | ||
283 | } | ||
284 | } | ||
260 | break; | 285 | break; |
261 | case PacketType.ObjectScale: | 286 | case PacketType.ObjectScale: |
262 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(Pack.ToString()); | 287 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(Pack.ToString()); |
@@ -555,8 +580,6 @@ namespace OpenSim | |||
555 | } | 580 | } |
556 | } | 581 | } |
557 | 582 | ||
558 | //MainConsole.Instance.WriteLine("OUT: \n" + Pack.ToString()); | ||
559 | |||
560 | byte[] ZeroOutBuffer = new byte[4096]; | 583 | byte[] ZeroOutBuffer = new byte[4096]; |
561 | byte[] sendbuffer; | 584 | byte[] sendbuffer; |
562 | sendbuffer = Pack.ToBytes(); | 585 | sendbuffer = Pack.ToBytes(); |
diff --git a/OpenSim.RegionServer/world/Primitive.cs b/OpenSim.RegionServer/world/Primitive.cs index f60d991..156bbfb 100644 --- a/OpenSim.RegionServer/world/Primitive.cs +++ b/OpenSim.RegionServer/world/Primitive.cs | |||
@@ -246,7 +246,7 @@ namespace OpenSim.world | |||
246 | OurPacket.ObjectData[0].Scale = this.primData.Scale; | 246 | OurPacket.ObjectData[0].Scale = this.primData.Scale; |
247 | OurPacket.ObjectData[0].PathCurve = this.primData.PathCurve; | 247 | OurPacket.ObjectData[0].PathCurve = this.primData.PathCurve; |
248 | OurPacket.ObjectData[0].ProfileCurve = this.primData.ProfileCurve; | 248 | OurPacket.ObjectData[0].ProfileCurve = this.primData.ProfileCurve; |
249 | OurPacket.ObjectData[0].ParentID = 0; | 249 | OurPacket.ObjectData[0].ParentID = this.primData.ParentID ; |
250 | OurPacket.ObjectData[0].ProfileHollow = this.primData.ProfileHollow; | 250 | OurPacket.ObjectData[0].ProfileHollow = this.primData.ProfileHollow; |
251 | //finish off copying rest of shape data | 251 | //finish off copying rest of shape data |
252 | OurPacket.ObjectData[0].PathRadiusOffset = this.primData.PathRadiusOffset; | 252 | OurPacket.ObjectData[0].PathRadiusOffset = this.primData.PathRadiusOffset; |
@@ -316,6 +316,13 @@ namespace OpenSim.world | |||
316 | } | 316 | } |
317 | } | 317 | } |
318 | 318 | ||
319 | public void MakeParent(Primitive prim) | ||
320 | { | ||
321 | this.primData.ParentID = prim.localid; | ||
322 | this.position -= prim.position; | ||
323 | this.dirtyFlag = true; | ||
324 | } | ||
325 | |||
319 | public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID) | 326 | public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID) |
320 | { | 327 | { |
321 | ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); | 328 | ObjectUpdatePacket objupdate = new ObjectUpdatePacket(); |