diff options
Diffstat (limited to 'OpenSim/OpenSim.RegionServer/ClientView.API.cs')
-rw-r--r-- | OpenSim/OpenSim.RegionServer/ClientView.API.cs | 98 |
1 files changed, 96 insertions, 2 deletions
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.API.cs b/OpenSim/OpenSim.RegionServer/ClientView.API.cs index 37e27f8..94d8cbd 100644 --- a/OpenSim/OpenSim.RegionServer/ClientView.API.cs +++ b/OpenSim/OpenSim.RegionServer/ClientView.API.cs | |||
@@ -325,7 +325,7 @@ namespace OpenSim | |||
325 | /// | 325 | /// |
326 | /// </summary> | 326 | /// </summary> |
327 | /// <param name="objdata"></param> | 327 | /// <param name="objdata"></param> |
328 | protected void SetDefaultPacketValues(ref ObjectUpdatePacket.ObjectDataBlock objdata) | 328 | protected void SetDefaultAvatarPacketValues(ref ObjectUpdatePacket.ObjectDataBlock objdata) |
329 | { | 329 | { |
330 | objdata.PSBlock = new byte[0]; | 330 | objdata.PSBlock = new byte[0]; |
331 | objdata.ExtraParams = new byte[1]; | 331 | objdata.ExtraParams = new byte[1]; |
@@ -361,7 +361,7 @@ namespace OpenSim | |||
361 | { | 361 | { |
362 | libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i); | 362 | libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i); |
363 | 363 | ||
364 | SetDefaultPacketValues(ref objdata); | 364 | SetDefaultAvatarPacketValues(ref objdata); |
365 | objdata.UpdateFlags = 61 + (9 << 8) + (130 << 16) + (16 << 24); | 365 | objdata.UpdateFlags = 61 + (9 << 8) + (130 << 16) + (16 << 24); |
366 | objdata.PathCurve = 16; | 366 | objdata.PathCurve = 16; |
367 | objdata.ProfileCurve = 1; | 367 | objdata.ProfileCurve = 1; |
@@ -412,6 +412,100 @@ namespace OpenSim | |||
412 | 412 | ||
413 | return agentData; | 413 | return agentData; |
414 | } | 414 | } |
415 | |||
416 | #region Primitive Packet/data Sending Methods | ||
417 | |||
418 | /// <summary> | ||
419 | /// Sends a full ObjectUpdatePacket to a client to inform it of a new primitive | ||
420 | /// or big changes to a existing primitive. | ||
421 | /// </summary> | ||
422 | /// <param name="primData"></param> | ||
423 | /// <param name="pos"></param> | ||
424 | public void SendPrimitiveToClient( PrimData primData, LLVector3 pos) | ||
425 | { | ||
426 | ObjectUpdatePacket outPacket = new ObjectUpdatePacket(); | ||
427 | outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; | ||
428 | outPacket.ObjectData[0] = this.CreatePrimUpdateBlock(primData); | ||
429 | byte[] pb = pos.GetBytes(); | ||
430 | Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length); | ||
431 | |||
432 | OutPacket(outPacket); | ||
433 | } | ||
434 | |||
435 | /// <summary> | ||
436 | /// Create the ObjectDataBlock for a ObjectUpdatePacket (for a Primitive) | ||
437 | /// </summary> | ||
438 | /// <param name="primData"></param> | ||
439 | /// <returns></returns> | ||
440 | protected ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(PrimData primData) | ||
441 | { | ||
442 | ObjectUpdatePacket.ObjectDataBlock objupdate = new ObjectUpdatePacket.ObjectDataBlock(); | ||
443 | this.SetDefaultPrimPacketValues(objupdate); | ||
444 | objupdate.UpdateFlags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456; | ||
445 | this.SetPrimPacketShapeData(objupdate, primData); | ||
446 | |||
447 | return objupdate; | ||
448 | } | ||
449 | |||
450 | /// <summary> | ||
451 | /// Set some default values in a ObjectUpdatePacket | ||
452 | /// </summary> | ||
453 | /// <param name="objdata"></param> | ||
454 | protected void SetDefaultPrimPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata) | ||
455 | { | ||
456 | objdata.PSBlock = new byte[0]; | ||
457 | objdata.ExtraParams = new byte[1]; | ||
458 | objdata.MediaURL = new byte[0]; | ||
459 | objdata.NameValue = new byte[0]; | ||
460 | objdata.Text = new byte[0]; | ||
461 | objdata.TextColor = new byte[4]; | ||
462 | objdata.JointAxisOrAnchor = new LLVector3(0, 0, 0); | ||
463 | objdata.JointPivot = new LLVector3(0, 0, 0); | ||
464 | objdata.Material = 3; | ||
465 | objdata.TextureAnim = new byte[0]; | ||
466 | objdata.Sound = LLUUID.Zero; | ||
467 | LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); | ||
468 | objdata.TextureEntry = ntex.ToBytes(); | ||
469 | objdata.State = 0; | ||
470 | objdata.Data = new byte[0]; | ||
471 | |||
472 | objdata.ObjectData = new byte[60]; | ||
473 | objdata.ObjectData[46] = 128; | ||
474 | objdata.ObjectData[47] = 63; | ||
475 | } | ||
476 | |||
477 | /// <summary> | ||
478 | /// Copy the data from a PrimData object to a ObjectUpdatePacket | ||
479 | /// </summary> | ||
480 | /// <param name="objectData"></param> | ||
481 | /// <param name="primData"></param> | ||
482 | protected void SetPrimPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData, PrimData primData) | ||
483 | { | ||
484 | objectData.OwnerID = primData.OwnerID; | ||
485 | objectData.PCode = primData.PCode; | ||
486 | objectData.PathBegin =primData.PathBegin; | ||
487 | objectData.PathEnd = primData.PathEnd; | ||
488 | objectData.PathScaleX = primData.PathScaleX; | ||
489 | objectData.PathScaleY = primData.PathScaleY; | ||
490 | objectData.PathShearX = primData.PathShearX; | ||
491 | objectData.PathShearY = primData.PathShearY; | ||
492 | objectData.PathSkew = primData.PathSkew; | ||
493 | objectData.ProfileBegin = primData.ProfileBegin; | ||
494 | objectData.ProfileEnd = primData.ProfileEnd; | ||
495 | objectData.Scale = primData.Scale; | ||
496 | objectData.PathCurve = primData.PathCurve; | ||
497 | objectData.ProfileCurve = primData.ProfileCurve; | ||
498 | objectData.ParentID = primData.ParentID; | ||
499 | objectData.ProfileHollow = primData.ProfileHollow; | ||
500 | objectData.PathRadiusOffset = primData.PathRadiusOffset; | ||
501 | objectData.PathRevolutions = primData.PathRevolutions; | ||
502 | objectData.PathTaperX = primData.PathTaperX; | ||
503 | objectData.PathTaperY = primData.PathTaperY; | ||
504 | objectData.PathTwist = primData.PathTwist; | ||
505 | objectData.PathTwistBegin = primData.PathTwistBegin; | ||
506 | } | ||
507 | #endregion | ||
508 | |||
415 | #endregion | 509 | #endregion |
416 | 510 | ||
417 | } | 511 | } |