aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.RegionServer
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/OpenSim.RegionServer')
-rw-r--r--OpenSim/OpenSim.RegionServer/ClientView.API.cs40
1 files changed, 34 insertions, 6 deletions
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.API.cs b/OpenSim/OpenSim.RegionServer/ClientView.API.cs
index 780035c..f7d98bb 100644
--- a/OpenSim/OpenSim.RegionServer/ClientView.API.cs
+++ b/OpenSim/OpenSim.RegionServer/ClientView.API.cs
@@ -448,6 +448,34 @@ namespace OpenSim
448 /// Sends a full ObjectUpdatePacket to a client to inform it of a new primitive 448 /// Sends a full ObjectUpdatePacket to a client to inform it of a new primitive
449 /// or big changes to a existing primitive. 449 /// or big changes to a existing primitive.
450 /// </summary> 450 /// </summary>
451 /// <param name="regionHandle"></param>
452 /// <param name="timeDilation"></param>
453 /// <param name="localID"></param>
454 /// <param name="primData"></param>
455 /// <param name="pos"></param>
456 /// <param name="rotation"></param>
457 /// <param name="textureID"></param>
458 public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID)
459 {
460 ObjectUpdatePacket outPacket = new ObjectUpdatePacket();
461 outPacket.RegionData.RegionHandle = regionHandle;
462 outPacket.RegionData.TimeDilation = timeDilation;
463 outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
464 outPacket.ObjectData[0] = this.CreatePrimUpdateBlock(primData, textureID);
465 outPacket.ObjectData[0].ID = localID;
466 outPacket.ObjectData[0].FullID = primData.FullID;
467 byte[] pb = pos.GetBytes();
468 Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
469 byte[] rot = rotation.GetBytes();
470 Array.Copy(rot, 0, outPacket.ObjectData[0].ObjectData, 48, rot.Length);
471 OutPacket(outPacket);
472 }
473
474 /// <summary>
475 /// Sends a full ObjectUpdatePacket to a client to inform it of a new primitive
476 /// or big changes to a existing primitive.
477 /// uses default rotation
478 /// </summary>
451 /// <param name="primData"></param> 479 /// <param name="primData"></param>
452 /// <param name="pos"></param> 480 /// <param name="pos"></param>
453 public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID) 481 public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID)
@@ -473,9 +501,9 @@ namespace OpenSim
473 protected ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(PrimData primData, LLUUID textureID) 501 protected ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(PrimData primData, LLUUID textureID)
474 { 502 {
475 ObjectUpdatePacket.ObjectDataBlock objupdate = new ObjectUpdatePacket.ObjectDataBlock(); 503 ObjectUpdatePacket.ObjectDataBlock objupdate = new ObjectUpdatePacket.ObjectDataBlock();
476 this.SetDefaultPrimPacketValues(objupdate, textureID); 504 this.SetDefaultPrimPacketValues(objupdate);
477 objupdate.UpdateFlags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456; 505 objupdate.UpdateFlags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456;
478 this.SetPrimPacketShapeData(objupdate, primData); 506 this.SetPrimPacketShapeData(objupdate, primData, textureID);
479 507
480 return objupdate; 508 return objupdate;
481 } 509 }
@@ -484,7 +512,7 @@ namespace OpenSim
484 /// Set some default values in a ObjectUpdatePacket 512 /// Set some default values in a ObjectUpdatePacket
485 /// </summary> 513 /// </summary>
486 /// <param name="objdata"></param> 514 /// <param name="objdata"></param>
487 protected void SetDefaultPrimPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata, LLUUID textureID) 515 protected void SetDefaultPrimPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata)
488 { 516 {
489 objdata.PSBlock = new byte[0]; 517 objdata.PSBlock = new byte[0];
490 objdata.ExtraParams = new byte[1]; 518 objdata.ExtraParams = new byte[1];
@@ -497,8 +525,6 @@ namespace OpenSim
497 objdata.Material = 3; 525 objdata.Material = 3;
498 objdata.TextureAnim = new byte[0]; 526 objdata.TextureAnim = new byte[0];
499 objdata.Sound = LLUUID.Zero; 527 objdata.Sound = LLUUID.Zero;
500 LLObject.TextureEntry ntex = new LLObject.TextureEntry(textureID);
501 objdata.TextureEntry = ntex.ToBytes();
502 objdata.State = 0; 528 objdata.State = 0;
503 objdata.Data = new byte[0]; 529 objdata.Data = new byte[0];
504 530
@@ -512,8 +538,10 @@ namespace OpenSim
512 /// </summary> 538 /// </summary>
513 /// <param name="objectData"></param> 539 /// <param name="objectData"></param>
514 /// <param name="primData"></param> 540 /// <param name="primData"></param>
515 protected void SetPrimPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData, PrimData primData) 541 protected void SetPrimPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData, PrimData primData, LLUUID textureID)
516 { 542 {
543 LLObject.TextureEntry ntex = new LLObject.TextureEntry(textureID);
544 objectData.TextureEntry = ntex.ToBytes();
517 objectData.OwnerID = primData.OwnerID; 545 objectData.OwnerID = primData.OwnerID;
518 objectData.PCode = primData.PCode; 546 objectData.PCode = primData.PCode;
519 objectData.PathBegin =primData.PathBegin; 547 objectData.PathBegin =primData.PathBegin;