diff options
author | MW | 2007-06-14 10:16:28 +0000 |
---|---|---|
committer | MW | 2007-06-14 10:16:28 +0000 |
commit | fd8ead61f6993f54e2f932f8bbdd183f78b72651 (patch) | |
tree | 2cfc7d3a123facbf57278e4505668350e7c97684 | |
parent | * Added experimental RegionHandle class to Framework.Types - see email posted... (diff) | |
download | opensim-SC-fd8ead61f6993f54e2f932f8bbdd183f78b72651.zip opensim-SC-fd8ead61f6993f54e2f932f8bbdd183f78b72651.tar.gz opensim-SC-fd8ead61f6993f54e2f932f8bbdd183f78b72651.tar.bz2 opensim-SC-fd8ead61f6993f54e2f932f8bbdd183f78b72651.tar.xz |
Fixed the bug that makes a region use its water height as its name (in regionhandshake), which lead to most regions being called "20". (applied fix to sugilite)
Rearranged some of the methods in ClientView.API.
-rw-r--r-- | OpenSim/OpenSim.Region/Scene/Entities/Primitive.cs | 38 | ||||
-rw-r--r-- | OpenSim/OpenSim.Region/Scene/Scene.cs | 6 | ||||
-rw-r--r-- | OpenSim/OpenSim.RegionServer/ClientView.API.cs | 333 | ||||
-rw-r--r-- | OpenSim/OpenSim.RegionServer/ClientView.PacketHandlers.cs | 32 |
4 files changed, 222 insertions, 187 deletions
diff --git a/OpenSim/OpenSim.Region/Scene/Entities/Primitive.cs b/OpenSim/OpenSim.Region/Scene/Entities/Primitive.cs index aa747d3..f3972af 100644 --- a/OpenSim/OpenSim.Region/Scene/Entities/Primitive.cs +++ b/OpenSim/OpenSim.Region/Scene/Entities/Primitive.cs | |||
@@ -245,26 +245,26 @@ namespace OpenSim.Region | |||
245 | /// | 245 | /// |
246 | /// </summary> | 246 | /// </summary> |
247 | /// <param name="addPacket"></param> | 247 | /// <param name="addPacket"></param> |
248 | public void UpdateShape(ObjectShapePacket.ObjectDataBlock addPacket) | 248 | public void UpdateShape(ObjectShapePacket.ObjectDataBlock updatePacket) |
249 | { | 249 | { |
250 | this.primData.PathBegin = addPacket.PathBegin; | 250 | this.primData.PathBegin = updatePacket.PathBegin; |
251 | this.primData.PathEnd = addPacket.PathEnd; | 251 | this.primData.PathEnd = updatePacket.PathEnd; |
252 | this.primData.PathScaleX = addPacket.PathScaleX; | 252 | this.primData.PathScaleX = updatePacket.PathScaleX; |
253 | this.primData.PathScaleY = addPacket.PathScaleY; | 253 | this.primData.PathScaleY = updatePacket.PathScaleY; |
254 | this.primData.PathShearX = addPacket.PathShearX; | 254 | this.primData.PathShearX = updatePacket.PathShearX; |
255 | this.primData.PathShearY = addPacket.PathShearY; | 255 | this.primData.PathShearY = updatePacket.PathShearY; |
256 | this.primData.PathSkew = addPacket.PathSkew; | 256 | this.primData.PathSkew = updatePacket.PathSkew; |
257 | this.primData.ProfileBegin = addPacket.ProfileBegin; | 257 | this.primData.ProfileBegin = updatePacket.ProfileBegin; |
258 | this.primData.ProfileEnd = addPacket.ProfileEnd; | 258 | this.primData.ProfileEnd = updatePacket.ProfileEnd; |
259 | this.primData.PathCurve = addPacket.PathCurve; | 259 | this.primData.PathCurve = updatePacket.PathCurve; |
260 | this.primData.ProfileCurve = addPacket.ProfileCurve; | 260 | this.primData.ProfileCurve = updatePacket.ProfileCurve; |
261 | this.primData.ProfileHollow = addPacket.ProfileHollow; | 261 | this.primData.ProfileHollow = updatePacket.ProfileHollow; |
262 | this.primData.PathRadiusOffset = addPacket.PathRadiusOffset; | 262 | this.primData.PathRadiusOffset = updatePacket.PathRadiusOffset; |
263 | this.primData.PathRevolutions = addPacket.PathRevolutions; | 263 | this.primData.PathRevolutions = updatePacket.PathRevolutions; |
264 | this.primData.PathTaperX = addPacket.PathTaperX; | 264 | this.primData.PathTaperX = updatePacket.PathTaperX; |
265 | this.primData.PathTaperY = addPacket.PathTaperY; | 265 | this.primData.PathTaperY = updatePacket.PathTaperY; |
266 | this.primData.PathTwist = addPacket.PathTwist; | 266 | this.primData.PathTwist = updatePacket.PathTwist; |
267 | this.primData.PathTwistBegin = addPacket.PathTwistBegin; | 267 | this.primData.PathTwistBegin = updatePacket.PathTwistBegin; |
268 | } | 268 | } |
269 | 269 | ||
270 | /// <summary> | 270 | /// <summary> |
diff --git a/OpenSim/OpenSim.Region/Scene/Scene.cs b/OpenSim/OpenSim.Region/Scene/Scene.cs index 6b27f8f..9f0ab93 100644 --- a/OpenSim/OpenSim.Region/Scene/Scene.cs +++ b/OpenSim/OpenSim.Region/Scene/Scene.cs | |||
@@ -312,7 +312,6 @@ namespace OpenSim.Region | |||
312 | 312 | ||
313 | #endregion | 313 | #endregion |
314 | 314 | ||
315 | |||
316 | #region Regenerate Terrain | 315 | #region Regenerate Terrain |
317 | 316 | ||
318 | /// <summary> | 317 | /// <summary> |
@@ -638,6 +637,11 @@ namespace OpenSim.Region | |||
638 | return result; | 637 | return result; |
639 | } | 638 | } |
640 | 639 | ||
640 | /// <summary> | ||
641 | /// Request a Avatar by UUID | ||
642 | /// </summary> | ||
643 | /// <param name="avatarID"></param> | ||
644 | /// <returns></returns> | ||
641 | public Avatar RequestAvatar(LLUUID avatarID) | 645 | public Avatar RequestAvatar(LLUUID avatarID) |
642 | { | 646 | { |
643 | if (this.Avatars.ContainsKey(avatarID)) | 647 | if (this.Avatars.ContainsKey(avatarID)) |
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.API.cs b/OpenSim/OpenSim.RegionServer/ClientView.API.cs index b9773c6..3badec9 100644 --- a/OpenSim/OpenSim.RegionServer/ClientView.API.cs +++ b/OpenSim/OpenSim.RegionServer/ClientView.API.cs | |||
@@ -147,7 +147,7 @@ namespace OpenSim | |||
147 | 147 | ||
148 | handshake.RegionInfo.RegionFlags = (uint)regionInfo.estateSettings.regionFlags; | 148 | handshake.RegionInfo.RegionFlags = (uint)regionInfo.estateSettings.regionFlags; |
149 | 149 | ||
150 | handshake.RegionInfo.SimName = _enc.GetBytes(regionInfo.estateSettings.waterHeight + "\0"); | 150 | handshake.RegionInfo.SimName = _enc.GetBytes(regionInfo.RegionName + "\0"); |
151 | handshake.RegionInfo.SimOwner = regionInfo.MasterAvatarAssignedUUID; | 151 | handshake.RegionInfo.SimOwner = regionInfo.MasterAvatarAssignedUUID; |
152 | handshake.RegionInfo.TerrainBase0 = regionInfo.estateSettings.terrainBase0; | 152 | handshake.RegionInfo.TerrainBase0 = regionInfo.estateSettings.terrainBase0; |
153 | handshake.RegionInfo.TerrainBase1 = regionInfo.estateSettings.terrainBase1; | 153 | handshake.RegionInfo.TerrainBase1 = regionInfo.estateSettings.terrainBase1; |
@@ -266,6 +266,12 @@ namespace OpenSim | |||
266 | } | 266 | } |
267 | } | 267 | } |
268 | 268 | ||
269 | /// <summary> | ||
270 | /// | ||
271 | /// </summary> | ||
272 | /// <param name="neighbourHandle"></param> | ||
273 | /// <param name="neighbourIP"></param> | ||
274 | /// <param name="neighbourPort"></param> | ||
269 | public void InformClientOfNeighbour(ulong neighbourHandle, System.Net.IPAddress neighbourIP, ushort neighbourPort) | 275 | public void InformClientOfNeighbour(ulong neighbourHandle, System.Net.IPAddress neighbourIP, ushort neighbourPort) |
270 | { | 276 | { |
271 | EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket(); | 277 | EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket(); |
@@ -281,6 +287,10 @@ namespace OpenSim | |||
281 | OutPacket(enablesimpacket); | 287 | OutPacket(enablesimpacket); |
282 | } | 288 | } |
283 | 289 | ||
290 | /// <summary> | ||
291 | /// | ||
292 | /// </summary> | ||
293 | /// <returns></returns> | ||
284 | public AgentCircuitData RequestClientInfo() | 294 | public AgentCircuitData RequestClientInfo() |
285 | { | 295 | { |
286 | AgentCircuitData agentData = new AgentCircuitData(); | 296 | AgentCircuitData agentData = new AgentCircuitData(); |
@@ -383,70 +393,6 @@ namespace OpenSim | |||
383 | 393 | ||
384 | } | 394 | } |
385 | 395 | ||
386 | |||
387 | /// <summary> | ||
388 | /// | ||
389 | /// </summary> | ||
390 | /// <param name="objdata"></param> | ||
391 | protected void SetDefaultAvatarPacketValues(ref ObjectUpdatePacket.ObjectDataBlock objdata) | ||
392 | { | ||
393 | objdata.PSBlock = new byte[0]; | ||
394 | objdata.ExtraParams = new byte[1]; | ||
395 | objdata.MediaURL = new byte[0]; | ||
396 | objdata.NameValue = new byte[0]; | ||
397 | objdata.Text = new byte[0]; | ||
398 | objdata.TextColor = new byte[4]; | ||
399 | objdata.JointAxisOrAnchor = new LLVector3(0, 0, 0); | ||
400 | objdata.JointPivot = new LLVector3(0, 0, 0); | ||
401 | objdata.Material = 4; | ||
402 | objdata.TextureAnim = new byte[0]; | ||
403 | objdata.Sound = LLUUID.Zero; | ||
404 | LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); | ||
405 | objdata.TextureEntry = ntex.ToBytes(); | ||
406 | objdata.State = 0; | ||
407 | objdata.Data = new byte[0]; | ||
408 | |||
409 | objdata.ObjectData = new byte[76]; | ||
410 | objdata.ObjectData[15] = 128; | ||
411 | objdata.ObjectData[16] = 63; | ||
412 | objdata.ObjectData[56] = 128; | ||
413 | objdata.ObjectData[61] = 102; | ||
414 | objdata.ObjectData[62] = 40; | ||
415 | objdata.ObjectData[63] = 61; | ||
416 | objdata.ObjectData[64] = 189; | ||
417 | } | ||
418 | |||
419 | /// <summary> | ||
420 | /// | ||
421 | /// </summary> | ||
422 | /// <returns></returns> | ||
423 | protected ObjectUpdatePacket.ObjectDataBlock CreateDefaultAvatarPacket() | ||
424 | { | ||
425 | libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i); | ||
426 | |||
427 | SetDefaultAvatarPacketValues(ref objdata); | ||
428 | objdata.UpdateFlags = 61 + (9 << 8) + (130 << 16) + (16 << 24); | ||
429 | objdata.PathCurve = 16; | ||
430 | objdata.ProfileCurve = 1; | ||
431 | objdata.PathScaleX = 100; | ||
432 | objdata.PathScaleY = 100; | ||
433 | objdata.ParentID = 0; | ||
434 | objdata.OwnerID = LLUUID.Zero; | ||
435 | objdata.Scale = new LLVector3(1, 1, 1); | ||
436 | objdata.PCode = 47; | ||
437 | System.Text.Encoding enc = System.Text.Encoding.ASCII; | ||
438 | libsecondlife.LLVector3 pos = new LLVector3(objdata.ObjectData, 16); | ||
439 | pos.X = 100f; | ||
440 | objdata.ID = 8880000; | ||
441 | objdata.NameValue = enc.GetBytes("FirstName STRING RW SV Test \nLastName STRING RW SV User \0"); | ||
442 | libsecondlife.LLVector3 pos2 = new LLVector3(100f, 100f, 23f); | ||
443 | //objdata.FullID=user.AgentID; | ||
444 | byte[] pb = pos.GetBytes(); | ||
445 | Array.Copy(pb, 0, objdata.ObjectData, 16, pb.Length); | ||
446 | |||
447 | return objdata; | ||
448 | } | ||
449 | |||
450 | #endregion | 396 | #endregion |
451 | 397 | ||
452 | #region Primitive Packet/data Sending Methods | 398 | #region Primitive Packet/data Sending Methods |
@@ -521,78 +467,13 @@ namespace OpenSim | |||
521 | } | 467 | } |
522 | 468 | ||
523 | /// <summary> | 469 | /// <summary> |
524 | /// Create the ObjectDataBlock for a ObjectUpdatePacket (for a Primitive) | 470 | /// |
525 | /// </summary> | ||
526 | /// <param name="primData"></param> | ||
527 | /// <returns></returns> | ||
528 | protected ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(PrimData primData, LLUUID textureID) | ||
529 | { | ||
530 | ObjectUpdatePacket.ObjectDataBlock objupdate = new ObjectUpdatePacket.ObjectDataBlock(); | ||
531 | this.SetDefaultPrimPacketValues(objupdate); | ||
532 | objupdate.UpdateFlags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456; | ||
533 | this.SetPrimPacketShapeData(objupdate, primData, textureID); | ||
534 | |||
535 | return objupdate; | ||
536 | } | ||
537 | |||
538 | /// <summary> | ||
539 | /// Set some default values in a ObjectUpdatePacket | ||
540 | /// </summary> | ||
541 | /// <param name="objdata"></param> | ||
542 | protected void SetDefaultPrimPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata) | ||
543 | { | ||
544 | objdata.PSBlock = new byte[0]; | ||
545 | objdata.ExtraParams = new byte[1]; | ||
546 | objdata.MediaURL = new byte[0]; | ||
547 | objdata.NameValue = new byte[0]; | ||
548 | objdata.Text = new byte[0]; | ||
549 | objdata.TextColor = new byte[4]; | ||
550 | objdata.JointAxisOrAnchor = new LLVector3(0, 0, 0); | ||
551 | objdata.JointPivot = new LLVector3(0, 0, 0); | ||
552 | objdata.Material = 3; | ||
553 | objdata.TextureAnim = new byte[0]; | ||
554 | objdata.Sound = LLUUID.Zero; | ||
555 | objdata.State = 0; | ||
556 | objdata.Data = new byte[0]; | ||
557 | |||
558 | objdata.ObjectData = new byte[60]; | ||
559 | objdata.ObjectData[46] = 128; | ||
560 | objdata.ObjectData[47] = 63; | ||
561 | } | ||
562 | |||
563 | /// <summary> | ||
564 | /// Copy the data from a PrimData object to a ObjectUpdatePacket | ||
565 | /// </summary> | 471 | /// </summary> |
566 | /// <param name="objectData"></param> | 472 | /// <param name="regionHandle"></param> |
567 | /// <param name="primData"></param> | 473 | /// <param name="timeDilation"></param> |
568 | protected void SetPrimPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData, PrimData primData, LLUUID textureID) | 474 | /// <param name="localID"></param> |
569 | { | 475 | /// <param name="position"></param> |
570 | LLObject.TextureEntry ntex = new LLObject.TextureEntry(textureID); | 476 | /// <param name="rotation"></param> |
571 | objectData.TextureEntry = ntex.ToBytes(); | ||
572 | objectData.OwnerID = primData.OwnerID; | ||
573 | objectData.PCode = primData.PCode; | ||
574 | objectData.PathBegin =primData.PathBegin; | ||
575 | objectData.PathEnd = primData.PathEnd; | ||
576 | objectData.PathScaleX = primData.PathScaleX; | ||
577 | objectData.PathScaleY = primData.PathScaleY; | ||
578 | objectData.PathShearX = primData.PathShearX; | ||
579 | objectData.PathShearY = primData.PathShearY; | ||
580 | objectData.PathSkew = primData.PathSkew; | ||
581 | objectData.ProfileBegin = primData.ProfileBegin; | ||
582 | objectData.ProfileEnd = primData.ProfileEnd; | ||
583 | objectData.Scale = primData.Scale; | ||
584 | objectData.PathCurve = primData.PathCurve; | ||
585 | objectData.ProfileCurve = primData.ProfileCurve; | ||
586 | objectData.ParentID = primData.ParentID; | ||
587 | objectData.ProfileHollow = primData.ProfileHollow; | ||
588 | objectData.PathRadiusOffset = primData.PathRadiusOffset; | ||
589 | objectData.PathRevolutions = primData.PathRevolutions; | ||
590 | objectData.PathTaperX = primData.PathTaperX; | ||
591 | objectData.PathTaperY = primData.PathTaperY; | ||
592 | objectData.PathTwist = primData.PathTwist; | ||
593 | objectData.PathTwistBegin = primData.PathTwistBegin; | ||
594 | } | ||
595 | |||
596 | public void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation) | 477 | public void SendPrimTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, LLVector3 position, LLQuaternion rotation) |
597 | { | 478 | { |
598 | ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); | 479 | ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); |
@@ -604,6 +485,12 @@ namespace OpenSim | |||
604 | this.OutPacket(terse); | 485 | this.OutPacket(terse); |
605 | } | 486 | } |
606 | 487 | ||
488 | #endregion | ||
489 | |||
490 | #endregion | ||
491 | |||
492 | #region Helper Methods | ||
493 | |||
607 | /// <summary> | 494 | /// <summary> |
608 | /// | 495 | /// |
609 | /// </summary> | 496 | /// </summary> |
@@ -625,7 +512,7 @@ namespace OpenSim | |||
625 | bytes[i++] = (byte)((ID >> 24) % 256); | 512 | bytes[i++] = (byte)((ID >> 24) % 256); |
626 | bytes[i++] = 0; | 513 | bytes[i++] = 0; |
627 | bytes[i++] = 0; | 514 | bytes[i++] = 0; |
628 | 515 | ||
629 | byte[] pb = position.GetBytes(); | 516 | byte[] pb = position.GetBytes(); |
630 | Array.Copy(pb, 0, bytes, i, pb.Length); | 517 | Array.Copy(pb, 0, bytes, i, pb.Length); |
631 | i += 12; | 518 | i += 12; |
@@ -674,8 +561,178 @@ namespace OpenSim | |||
674 | dat.Data = bytes; | 561 | dat.Data = bytes; |
675 | return dat; | 562 | return dat; |
676 | } | 563 | } |
677 | #endregion | ||
678 | 564 | ||
565 | |||
566 | /// <summary> | ||
567 | /// Create the ObjectDataBlock for a ObjectUpdatePacket (for a Primitive) | ||
568 | /// </summary> | ||
569 | /// <param name="primData"></param> | ||
570 | /// <returns></returns> | ||
571 | protected ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(PrimData primData, LLUUID textureID) | ||
572 | { | ||
573 | ObjectUpdatePacket.ObjectDataBlock objupdate = new ObjectUpdatePacket.ObjectDataBlock(); | ||
574 | this.SetDefaultPrimPacketValues(objupdate); | ||
575 | objupdate.UpdateFlags = 32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456; | ||
576 | this.SetPrimPacketShapeData(objupdate, primData, textureID); | ||
577 | |||
578 | return objupdate; | ||
579 | } | ||
580 | |||
581 | /// <summary> | ||
582 | /// Copy the data from a PrimData object to a ObjectUpdatePacket | ||
583 | /// </summary> | ||
584 | /// <param name="objectData"></param> | ||
585 | /// <param name="primData"></param> | ||
586 | protected void SetPrimPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData, PrimData primData, LLUUID textureID) | ||
587 | { | ||
588 | LLObject.TextureEntry ntex = new LLObject.TextureEntry(textureID); | ||
589 | objectData.TextureEntry = ntex.ToBytes(); | ||
590 | objectData.OwnerID = primData.OwnerID; | ||
591 | objectData.PCode = primData.PCode; | ||
592 | objectData.PathBegin = primData.PathBegin; | ||
593 | objectData.PathEnd = primData.PathEnd; | ||
594 | objectData.PathScaleX = primData.PathScaleX; | ||
595 | objectData.PathScaleY = primData.PathScaleY; | ||
596 | objectData.PathShearX = primData.PathShearX; | ||
597 | objectData.PathShearY = primData.PathShearY; | ||
598 | objectData.PathSkew = primData.PathSkew; | ||
599 | objectData.ProfileBegin = primData.ProfileBegin; | ||
600 | objectData.ProfileEnd = primData.ProfileEnd; | ||
601 | objectData.Scale = primData.Scale; | ||
602 | objectData.PathCurve = primData.PathCurve; | ||
603 | objectData.ProfileCurve = primData.ProfileCurve; | ||
604 | objectData.ParentID = primData.ParentID; | ||
605 | objectData.ProfileHollow = primData.ProfileHollow; | ||
606 | objectData.PathRadiusOffset = primData.PathRadiusOffset; | ||
607 | objectData.PathRevolutions = primData.PathRevolutions; | ||
608 | objectData.PathTaperX = primData.PathTaperX; | ||
609 | objectData.PathTaperY = primData.PathTaperY; | ||
610 | objectData.PathTwist = primData.PathTwist; | ||
611 | objectData.PathTwistBegin = primData.PathTwistBegin; | ||
612 | } | ||
613 | |||
614 | /// <summary> | ||
615 | /// Set some default values in a ObjectUpdatePacket | ||
616 | /// </summary> | ||
617 | /// <param name="objdata"></param> | ||
618 | protected void SetDefaultPrimPacketValues(ObjectUpdatePacket.ObjectDataBlock objdata) | ||
619 | { | ||
620 | objdata.PSBlock = new byte[0]; | ||
621 | objdata.ExtraParams = new byte[1]; | ||
622 | objdata.MediaURL = new byte[0]; | ||
623 | objdata.NameValue = new byte[0]; | ||
624 | objdata.Text = new byte[0]; | ||
625 | objdata.TextColor = new byte[4]; | ||
626 | objdata.JointAxisOrAnchor = new LLVector3(0, 0, 0); | ||
627 | objdata.JointPivot = new LLVector3(0, 0, 0); | ||
628 | objdata.Material = 3; | ||
629 | objdata.TextureAnim = new byte[0]; | ||
630 | objdata.Sound = LLUUID.Zero; | ||
631 | objdata.State = 0; | ||
632 | objdata.Data = new byte[0]; | ||
633 | |||
634 | objdata.ObjectData = new byte[60]; | ||
635 | objdata.ObjectData[46] = 128; | ||
636 | objdata.ObjectData[47] = 63; | ||
637 | } | ||
638 | |||
639 | |||
640 | /// <summary> | ||
641 | /// | ||
642 | /// </summary> | ||
643 | /// <returns></returns> | ||
644 | protected ObjectUpdatePacket.ObjectDataBlock CreateDefaultAvatarPacket() | ||
645 | { | ||
646 | libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock objdata = new ObjectUpdatePacket.ObjectDataBlock(); // new libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock(data1, ref i); | ||
647 | |||
648 | SetDefaultAvatarPacketValues(ref objdata); | ||
649 | objdata.UpdateFlags = 61 + (9 << 8) + (130 << 16) + (16 << 24); | ||
650 | objdata.PathCurve = 16; | ||
651 | objdata.ProfileCurve = 1; | ||
652 | objdata.PathScaleX = 100; | ||
653 | objdata.PathScaleY = 100; | ||
654 | objdata.ParentID = 0; | ||
655 | objdata.OwnerID = LLUUID.Zero; | ||
656 | objdata.Scale = new LLVector3(1, 1, 1); | ||
657 | objdata.PCode = 47; | ||
658 | System.Text.Encoding enc = System.Text.Encoding.ASCII; | ||
659 | libsecondlife.LLVector3 pos = new LLVector3(objdata.ObjectData, 16); | ||
660 | pos.X = 100f; | ||
661 | objdata.ID = 8880000; | ||
662 | objdata.NameValue = enc.GetBytes("FirstName STRING RW SV Test \nLastName STRING RW SV User \0"); | ||
663 | libsecondlife.LLVector3 pos2 = new LLVector3(100f, 100f, 23f); | ||
664 | //objdata.FullID=user.AgentID; | ||
665 | byte[] pb = pos.GetBytes(); | ||
666 | Array.Copy(pb, 0, objdata.ObjectData, 16, pb.Length); | ||
667 | |||
668 | return objdata; | ||
669 | } | ||
670 | |||
671 | /// <summary> | ||
672 | /// | ||
673 | /// </summary> | ||
674 | /// <param name="objdata"></param> | ||
675 | protected void SetDefaultAvatarPacketValues(ref ObjectUpdatePacket.ObjectDataBlock objdata) | ||
676 | { | ||
677 | objdata.PSBlock = new byte[0]; | ||
678 | objdata.ExtraParams = new byte[1]; | ||
679 | objdata.MediaURL = new byte[0]; | ||
680 | objdata.NameValue = new byte[0]; | ||
681 | objdata.Text = new byte[0]; | ||
682 | objdata.TextColor = new byte[4]; | ||
683 | objdata.JointAxisOrAnchor = new LLVector3(0, 0, 0); | ||
684 | objdata.JointPivot = new LLVector3(0, 0, 0); | ||
685 | objdata.Material = 4; | ||
686 | objdata.TextureAnim = new byte[0]; | ||
687 | objdata.Sound = LLUUID.Zero; | ||
688 | LLObject.TextureEntry ntex = new LLObject.TextureEntry(new LLUUID("00000000-0000-0000-5005-000000000005")); | ||
689 | objdata.TextureEntry = ntex.ToBytes(); | ||
690 | objdata.State = 0; | ||
691 | objdata.Data = new byte[0]; | ||
692 | |||
693 | objdata.ObjectData = new byte[76]; | ||
694 | objdata.ObjectData[15] = 128; | ||
695 | objdata.ObjectData[16] = 63; | ||
696 | objdata.ObjectData[56] = 128; | ||
697 | objdata.ObjectData[61] = 102; | ||
698 | objdata.ObjectData[62] = 40; | ||
699 | objdata.ObjectData[63] = 61; | ||
700 | objdata.ObjectData[64] = 189; | ||
701 | } | ||
702 | |||
703 | /// <summary> | ||
704 | /// | ||
705 | /// </summary> | ||
706 | /// <param name="addPacket"></param> | ||
707 | /// <returns></returns> | ||
708 | protected PrimData CreatePrimFromObjectAdd(ObjectAddPacket addPacket) | ||
709 | { | ||
710 | PrimData PData = new PrimData(); | ||
711 | PData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; | ||
712 | PData.PCode = addPacket.ObjectData.PCode; | ||
713 | PData.PathBegin = addPacket.ObjectData.PathBegin; | ||
714 | PData.PathEnd = addPacket.ObjectData.PathEnd; | ||
715 | PData.PathScaleX = addPacket.ObjectData.PathScaleX; | ||
716 | PData.PathScaleY = addPacket.ObjectData.PathScaleY; | ||
717 | PData.PathShearX = addPacket.ObjectData.PathShearX; | ||
718 | PData.PathShearY = addPacket.ObjectData.PathShearY; | ||
719 | PData.PathSkew = addPacket.ObjectData.PathSkew; | ||
720 | PData.ProfileBegin = addPacket.ObjectData.ProfileBegin; | ||
721 | PData.ProfileEnd = addPacket.ObjectData.ProfileEnd; | ||
722 | PData.Scale = addPacket.ObjectData.Scale; | ||
723 | PData.PathCurve = addPacket.ObjectData.PathCurve; | ||
724 | PData.ProfileCurve = addPacket.ObjectData.ProfileCurve; | ||
725 | PData.ParentID = 0; | ||
726 | PData.ProfileHollow = addPacket.ObjectData.ProfileHollow; | ||
727 | PData.PathRadiusOffset = addPacket.ObjectData.PathRadiusOffset; | ||
728 | PData.PathRevolutions = addPacket.ObjectData.PathRevolutions; | ||
729 | PData.PathTaperX = addPacket.ObjectData.PathTaperX; | ||
730 | PData.PathTaperY = addPacket.ObjectData.PathTaperY; | ||
731 | PData.PathTwist = addPacket.ObjectData.PathTwist; | ||
732 | PData.PathTwistBegin = addPacket.ObjectData.PathTwistBegin; | ||
733 | |||
734 | return PData; | ||
735 | } | ||
679 | #endregion | 736 | #endregion |
680 | 737 | ||
681 | } | 738 | } |
diff --git a/OpenSim/OpenSim.RegionServer/ClientView.PacketHandlers.cs b/OpenSim/OpenSim.RegionServer/ClientView.PacketHandlers.cs index 035eb4c..c8961b6 100644 --- a/OpenSim/OpenSim.RegionServer/ClientView.PacketHandlers.cs +++ b/OpenSim/OpenSim.RegionServer/ClientView.PacketHandlers.cs | |||
@@ -145,8 +145,9 @@ namespace OpenSim | |||
145 | return true; | 145 | return true; |
146 | } | 146 | } |
147 | 147 | ||
148 | public void RequestMapLayer() //should be getting the map layer from the grid server | 148 | public void RequestMapLayer() |
149 | { | 149 | { |
150 | //should be getting the map layer from the grid server | ||
150 | //send a layer covering the 800,800 - 1200,1200 area (should be covering the requested area) | 151 | //send a layer covering the 800,800 - 1200,1200 area (should be covering the requested area) |
151 | MapLayerReplyPacket mapReply = new MapLayerReplyPacket(); | 152 | MapLayerReplyPacket mapReply = new MapLayerReplyPacket(); |
152 | mapReply.AgentData.AgentID = this.AgentID; | 153 | mapReply.AgentData.AgentID = this.AgentID; |
@@ -190,33 +191,6 @@ namespace OpenSim | |||
190 | this.OutPacket(mbReply); | 191 | this.OutPacket(mbReply); |
191 | } | 192 | } |
192 | 193 | ||
193 | protected PrimData CreatePrimFromObjectAdd(ObjectAddPacket addPacket) | 194 | |
194 | { | ||
195 | PrimData PData = new PrimData(); | ||
196 | PData.CreationDate = (Int32)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; | ||
197 | PData.PCode = addPacket.ObjectData.PCode; | ||
198 | PData.PathBegin = addPacket.ObjectData.PathBegin; | ||
199 | PData.PathEnd = addPacket.ObjectData.PathEnd; | ||
200 | PData.PathScaleX = addPacket.ObjectData.PathScaleX; | ||
201 | PData.PathScaleY = addPacket.ObjectData.PathScaleY; | ||
202 | PData.PathShearX = addPacket.ObjectData.PathShearX; | ||
203 | PData.PathShearY = addPacket.ObjectData.PathShearY; | ||
204 | PData.PathSkew = addPacket.ObjectData.PathSkew; | ||
205 | PData.ProfileBegin = addPacket.ObjectData.ProfileBegin; | ||
206 | PData.ProfileEnd = addPacket.ObjectData.ProfileEnd; | ||
207 | PData.Scale = addPacket.ObjectData.Scale; | ||
208 | PData.PathCurve = addPacket.ObjectData.PathCurve; | ||
209 | PData.ProfileCurve = addPacket.ObjectData.ProfileCurve; | ||
210 | PData.ParentID = 0; | ||
211 | PData.ProfileHollow = addPacket.ObjectData.ProfileHollow; | ||
212 | PData.PathRadiusOffset = addPacket.ObjectData.PathRadiusOffset; | ||
213 | PData.PathRevolutions = addPacket.ObjectData.PathRevolutions; | ||
214 | PData.PathTaperX = addPacket.ObjectData.PathTaperX; | ||
215 | PData.PathTaperY = addPacket.ObjectData.PathTaperY; | ||
216 | PData.PathTwist = addPacket.ObjectData.PathTwist; | ||
217 | PData.PathTwistBegin = addPacket.ObjectData.PathTwistBegin; | ||
218 | |||
219 | return PData; | ||
220 | } | ||
221 | } | 195 | } |
222 | } | 196 | } |