From ba2c94721c2f3b9dc263ad6ca635aa8a9c521ba5 Mon Sep 17 00:00:00 2001 From: MW Date: Tue, 3 Apr 2007 16:10:00 +0000 Subject: 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. --- OpenSim.RegionServer/SimClient.cs | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'OpenSim.RegionServer/SimClient.cs') 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 break; case PacketType.ObjectLink: OpenSim.Framework.Console.MainConsole.Instance.WriteLine(Pack.ToString()); + ObjectLinkPacket link = (ObjectLinkPacket)Pack; + uint parentprimid = 0; + OpenSim.world.Primitive parentprim = null; + if (link.ObjectData.Length > 1) + { + parentprimid = link.ObjectData[0].ObjectLocalID; + foreach (Entity ent in m_world.Entities.Values) + { + if (ent.localid == parentprimid) + { + parentprim = (OpenSim.world.Primitive)ent; + + } + } + for (int i = 1; i < link.ObjectData.Length; i++) + { + foreach (Entity ent in m_world.Entities.Values) + { + if (ent.localid == link.ObjectData[i].ObjectLocalID) + { + ((OpenSim.world.Primitive)ent).MakeParent(parentprim); + } + } + } + } break; case PacketType.ObjectScale: OpenSim.Framework.Console.MainConsole.Instance.WriteLine(Pack.ToString()); @@ -555,8 +580,6 @@ namespace OpenSim } } - //MainConsole.Instance.WriteLine("OUT: \n" + Pack.ToString()); - byte[] ZeroOutBuffer = new byte[4096]; byte[] sendbuffer; sendbuffer = Pack.ToBytes(); -- cgit v1.1