aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
authorMW2007-07-18 18:12:16 +0000
committerMW2007-07-18 18:12:16 +0000
commit643a02ec60151e1a501d1b260592695b90be6233 (patch)
tree55ec1fe8a36c91e8a59a579f62050b6d7b960345 /OpenSim/Region/ClientStack
parentJust trying things out, nothing to see here, please go back to sleep. (diff)
downloadopensim-SC-643a02ec60151e1a501d1b260592695b90be6233.zip
opensim-SC-643a02ec60151e1a501d1b260592695b90be6233.tar.gz
opensim-SC-643a02ec60151e1a501d1b260592695b90be6233.tar.bz2
opensim-SC-643a02ec60151e1a501d1b260592695b90be6233.tar.xz
More testing some ideas, to find best method for SceneObject Primitive classes.
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs101
-rw-r--r--OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs1
2 files changed, 2 insertions, 100 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index 044ad68..54ddd97 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -719,56 +719,7 @@ namespace OpenSim.Region.ClientStack
719 this.OutPacket(attach); 719 this.OutPacket(attach);
720 } 720 }
721 721
722 /// <summary> 722
723 /// Sends a full ObjectUpdatePacket to a client to inform it of a new primitive
724 /// or big changes to a existing primitive.
725 /// </summary>
726 /// <param name="regionHandle"></param>
727 /// <param name="timeDilation"></param>
728 /// <param name="localID"></param>
729 /// <param name="primData"></param>
730 /// <param name="pos"></param>
731 /// <param name="rotation"></param>
732 /// <param name="textureID"></param>
733 public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLQuaternion rotation, LLUUID textureID, uint flags)
734 {
735 ObjectUpdatePacket outPacket = new ObjectUpdatePacket();
736 outPacket.RegionData.RegionHandle = regionHandle;
737 outPacket.RegionData.TimeDilation = timeDilation;
738 outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
739 outPacket.ObjectData[0] = this.CreatePrimUpdateBlock(primData, textureID, flags);
740 outPacket.ObjectData[0].ID = localID;
741 outPacket.ObjectData[0].FullID = primData.FullID;
742 byte[] pb = pos.GetBytes();
743 Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
744 byte[] rot = rotation.GetBytes();
745 Array.Copy(rot, 0, outPacket.ObjectData[0].ObjectData, 48, rot.Length);
746 OutPacket(outPacket);
747 }
748
749 /// <summary>
750 /// Sends a full ObjectUpdatePacket to a client to inform it of a new primitive
751 /// or big changes to a existing primitive.
752 /// Uses default rotation
753 /// </summary>
754 /// <param name="primData"></param>
755 /// <param name="pos"></param>
756 public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID, uint flags)
757 {
758 ObjectUpdatePacket outPacket = new ObjectUpdatePacket();
759 outPacket.RegionData.RegionHandle = regionHandle;
760 outPacket.RegionData.TimeDilation = timeDilation;
761 outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
762 outPacket.ObjectData[0] = this.CreatePrimUpdateBlock(primData, textureID, flags);
763 outPacket.ObjectData[0].ID = localID;
764 outPacket.ObjectData[0].FullID = primData.FullID;
765 byte[] pb = pos.GetBytes();
766 Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
767
768 OutPacket(outPacket);
769 }
770
771
772 public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLQuaternion rotation, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID) 723 public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, LLQuaternion rotation, uint flags, LLUUID objectID, LLUUID ownerID, string text, uint parentID)
773 { 724 {
774 ObjectUpdatePacket outPacket = new ObjectUpdatePacket(); 725 ObjectUpdatePacket outPacket = new ObjectUpdatePacket();
@@ -978,22 +929,6 @@ namespace OpenSim.Region.ClientStack
978 return dat; 929 return dat;
979 } 930 }
980 931
981
982 /// <summary>
983 /// Create the ObjectDataBlock for a ObjectUpdatePacket (for a Primitive)
984 /// </summary>
985 /// <param name="primData"></param>
986 /// <returns></returns>
987 protected ObjectUpdatePacket.ObjectDataBlock CreatePrimUpdateBlock(PrimData primData, LLUUID textureID, uint flags)
988 {
989 ObjectUpdatePacket.ObjectDataBlock objupdate = new ObjectUpdatePacket.ObjectDataBlock();
990 this.SetDefaultPrimPacketValues(objupdate);
991 objupdate.UpdateFlags = flags;
992 this.SetPrimPacketShapeData(objupdate, primData, textureID);
993
994 return objupdate;
995 }
996
997 /// <summary> 932 /// <summary>
998 /// Create the ObjectDataBlock for a ObjectUpdatePacket (for a Primitive) 933 /// Create the ObjectDataBlock for a ObjectUpdatePacket (for a Primitive)
999 /// </summary> 934 /// </summary>
@@ -1009,40 +944,6 @@ namespace OpenSim.Region.ClientStack
1009 return objupdate; 944 return objupdate;
1010 } 945 }
1011 946
1012
1013 /// <summary>
1014 /// Copy the data from a PrimData object to a ObjectUpdatePacket
1015 /// </summary>
1016 /// <param name="objectData"></param>
1017 /// <param name="primData"></param>
1018 protected void SetPrimPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData, PrimData primData, LLUUID textureID)
1019 {
1020 LLObject.TextureEntry ntex = new LLObject.TextureEntry(textureID);
1021 objectData.TextureEntry = ntex.ToBytes();
1022 objectData.OwnerID = primData.OwnerID;
1023 objectData.ParentID = primData.ParentID;
1024 objectData.PCode = primData.PCode;
1025 objectData.PathBegin = primData.PathBegin;
1026 objectData.PathEnd = primData.PathEnd;
1027 objectData.PathScaleX = primData.PathScaleX;
1028 objectData.PathScaleY = primData.PathScaleY;
1029 objectData.PathShearX = primData.PathShearX;
1030 objectData.PathShearY = primData.PathShearY;
1031 objectData.PathSkew = primData.PathSkew;
1032 objectData.ProfileBegin = primData.ProfileBegin;
1033 objectData.ProfileEnd = primData.ProfileEnd;
1034 objectData.Scale = primData.Scale;
1035 objectData.PathCurve = primData.PathCurve;
1036 objectData.ProfileCurve = primData.ProfileCurve;
1037 objectData.ProfileHollow = primData.ProfileHollow;
1038 objectData.PathRadiusOffset = primData.PathRadiusOffset;
1039 objectData.PathRevolutions = primData.PathRevolutions;
1040 objectData.PathTaperX = primData.PathTaperX;
1041 objectData.PathTaperY = primData.PathTaperY;
1042 objectData.PathTwist = primData.PathTwist;
1043 objectData.PathTwistBegin = primData.PathTwistBegin;
1044 }
1045
1046 protected void SetPrimPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData, PrimitiveBaseShape primData) 947 protected void SetPrimPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData, PrimitiveBaseShape primData)
1047 { 948 {
1048 949
diff --git a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
index dd0a6c8..338471e 100644
--- a/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
+++ b/OpenSim/Region/ClientStack/ClientView.ProcessPackets.cs
@@ -218,6 +218,7 @@ namespace OpenSim.Region.ClientStack
218 if (OnAddPrim != null) 218 if (OnAddPrim != null)
219 { 219 {
220 ObjectAddPacket addPacket = (ObjectAddPacket) Pack ; 220 ObjectAddPacket addPacket = (ObjectAddPacket) Pack ;
221 Console.WriteLine(addPacket.ToString());
221 222
222 PrimitiveBaseShape shape = new PrimitiveBaseShape(); 223 PrimitiveBaseShape shape = new PrimitiveBaseShape();
223 224