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.

0.1-prestable
MW 2007-04-03 16:10:00 +00:00
parent 56e6587c9f
commit ba2c94721c
2 changed files with 33 additions and 3 deletions

View File

@ -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();

View File

@ -246,7 +246,7 @@ namespace OpenSim.world
OurPacket.ObjectData[0].Scale = this.primData.Scale;
OurPacket.ObjectData[0].PathCurve = this.primData.PathCurve;
OurPacket.ObjectData[0].ProfileCurve = this.primData.ProfileCurve;
OurPacket.ObjectData[0].ParentID = 0;
OurPacket.ObjectData[0].ParentID = this.primData.ParentID ;
OurPacket.ObjectData[0].ProfileHollow = this.primData.ProfileHollow;
//finish off copying rest of shape data
OurPacket.ObjectData[0].PathRadiusOffset = this.primData.PathRadiusOffset;
@ -316,6 +316,13 @@ namespace OpenSim.world
}
}
public void MakeParent(Primitive prim)
{
this.primData.ParentID = prim.localid;
this.position -= prim.position;
this.dirtyFlag = true;
}
public void CreateFromPacket(ObjectAddPacket addPacket, LLUUID agentID, uint localID)
{
ObjectUpdatePacket objupdate = new ObjectUpdatePacket();