aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/ClientView.cs
diff options
context:
space:
mode:
authorTeravus Ovares2008-04-24 11:32:41 +0000
committerTeravus Ovares2008-04-24 11:32:41 +0000
commitaa8aee90a35458f1f601ca23e2298b212782d0a3 (patch)
tree37c2645867cba040a4ad7e32d1b5ccd56d155d87 /OpenSim/Region/ClientStack/ClientView.cs
parent* From: Alan M Webb <awebb.vnet.ibm.com> (diff)
downloadopensim-SC_OLD-aa8aee90a35458f1f601ca23e2298b212782d0a3.zip
opensim-SC_OLD-aa8aee90a35458f1f601ca23e2298b212782d0a3.tar.gz
opensim-SC_OLD-aa8aee90a35458f1f601ca23e2298b212782d0a3.tar.bz2
opensim-SC_OLD-aa8aee90a35458f1f601ca23e2298b212782d0a3.tar.xz
* Adds much better support for attachments that you right click on in world.
* Your friends can see your attachments now. People who appear in the sim after you've attached something can also see your attachments. * You can position & rotate your attachments now. Positions do *not* save. * You can detach attachments now the regular way. * Attachments do not cross into other regions with you..(this isn't too far off) * Updated ODE to not request terse updates on child prim.
Diffstat (limited to 'OpenSim/Region/ClientStack/ClientView.cs')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.cs34
1 files changed, 32 insertions, 2 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index 216633f..0a6431d 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -235,6 +235,7 @@ namespace OpenSim.Region.ClientStack
235 235
236 private ScriptAnswer handlerScriptAnswer = null; 236 private ScriptAnswer handlerScriptAnswer = null;
237 private RequestPayPrice handlerRequestPayPrice = null; 237 private RequestPayPrice handlerRequestPayPrice = null;
238 private ObjectDeselect handlerObjectDetach = null;
238 239
239 /* Properties */ 240 /* Properties */
240 241
@@ -689,6 +690,7 @@ namespace OpenSim.Region.ClientStack
689 public event AvatarNowWearing OnAvatarNowWearing; 690 public event AvatarNowWearing OnAvatarNowWearing;
690 public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv; 691 public event RezSingleAttachmentFromInv OnRezSingleAttachmentFromInv;
691 public event ObjectAttach OnObjectAttach; 692 public event ObjectAttach OnObjectAttach;
693 public event ObjectDeselect OnObjectDetach;
692 public event GenericCall2 OnCompleteMovementToRegion; 694 public event GenericCall2 OnCompleteMovementToRegion;
693 public event UpdateAgent OnAgentUpdate; 695 public event UpdateAgent OnAgentUpdate;
694 public event AgentRequestSit OnAgentRequestSit; 696 public event AgentRequestSit OnAgentRequestSit;
@@ -1989,6 +1991,7 @@ namespace OpenSim.Region.ClientStack
1989 /// <param name="attachPoint"></param> 1991 /// <param name="attachPoint"></param>
1990 public void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint) 1992 public void AttachObject(uint localID, LLQuaternion rotation, byte attachPoint)
1991 { 1993 {
1994
1992 ObjectAttachPacket attach = (ObjectAttachPacket)PacketPool.Instance.GetPacket(PacketType.ObjectAttach); 1995 ObjectAttachPacket attach = (ObjectAttachPacket)PacketPool.Instance.GetPacket(PacketType.ObjectAttach);
1993 Console.WriteLine("Attach object!"); 1996 Console.WriteLine("Attach object!");
1994 // TODO: don't create new blocks if recycling an old packet 1997 // TODO: don't create new blocks if recycling an old packet
@@ -2013,13 +2016,13 @@ namespace OpenSim.Region.ClientStack
2013 2016
2014 SendPrimitiveToClient(regionHandle, timeDilation, localID, primShape, pos, flags, 2017 SendPrimitiveToClient(regionHandle, timeDilation, localID, primShape, pos, flags,
2015 objectID, ownerID, text, color, parentID, particleSystem, 2018 objectID, ownerID, text, color, parentID, particleSystem,
2016 rotation, clickAction, textureanim); 2019 rotation, clickAction, textureanim, false,(uint)0);
2017 } 2020 }
2018 public void SendPrimitiveToClient( 2021 public void SendPrimitiveToClient(
2019 ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, 2022 ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos,
2020 uint flags, 2023 uint flags,
2021 LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, 2024 LLUUID objectID, LLUUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem,
2022 LLQuaternion rotation, byte clickAction, byte[] textureanim) 2025 LLQuaternion rotation, byte clickAction, byte[] textureanim, bool attachment, uint AttachPoint)
2023 { 2026 {
2024 ObjectUpdatePacket outPacket = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate); 2027 ObjectUpdatePacket outPacket = (ObjectUpdatePacket)PacketPool.Instance.GetPacket(PacketType.ObjectUpdate);
2025 // TODO: don't create new blocks if recycling an old packet 2028 // TODO: don't create new blocks if recycling an old packet
@@ -2050,6 +2053,18 @@ namespace OpenSim.Region.ClientStack
2050 outPacket.ObjectData[0].ClickAction = clickAction; 2053 outPacket.ObjectData[0].ClickAction = clickAction;
2051 //outPacket.ObjectData[0].Flags = 0; 2054 //outPacket.ObjectData[0].Flags = 0;
2052 2055
2056 if (attachment)
2057 {
2058 // Necessary???
2059 outPacket.ObjectData[0].JointAxisOrAnchor = new LLVector3(0, 0, 2);
2060 outPacket.ObjectData[0].JointPivot = new LLVector3(0, 0, 0);
2061
2062 // Item from inventory???
2063 outPacket.ObjectData[0].NameValue =
2064 Helpers.StringToField("AttachItemID STRING RW SV " + objectID.UUID);
2065 outPacket.ObjectData[0].State = (byte)(((byte)AttachPoint) << 4);
2066 }
2067
2053 // Sound Radius 2068 // Sound Radius
2054 outPacket.ObjectData[0].Radius = 20; 2069 outPacket.ObjectData[0].Radius = 20;
2055 2070
@@ -3438,6 +3453,21 @@ namespace OpenSim.Region.ClientStack
3438 } 3453 }
3439 3454
3440 break; 3455 break;
3456 case PacketType.ObjectDetach:
3457
3458 ObjectDetachPacket dett = (ObjectDetachPacket)Pack;
3459 for (int j = 0; j < dett.ObjectData.Length; j++)
3460 {
3461 uint obj = dett.ObjectData[j].ObjectLocalID;
3462 handlerObjectDetach = OnObjectDetach;
3463 if (handlerObjectDetach != null)
3464 {
3465 handlerObjectDetach(obj,this);
3466 }
3467
3468 }
3469
3470 break;
3441 case PacketType.SetAlwaysRun: 3471 case PacketType.SetAlwaysRun:
3442 SetAlwaysRunPacket run = (SetAlwaysRunPacket)Pack; 3472 SetAlwaysRunPacket run = (SetAlwaysRunPacket)Pack;
3443 3473