aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
diff options
context:
space:
mode:
authorMW2009-02-28 14:04:02 +0000
committerMW2009-02-28 14:04:02 +0000
commitd6b8b41a5b5683ca35a495dd3e16a55d5c82add2 (patch)
tree782609c71c3bdb097e5174ae47472eb4bbfff19c /OpenSim/Client/MXP/ClientStack/MXPClientView.cs
parentupdating svn ignore properties (diff)
downloadopensim-SC-d6b8b41a5b5683ca35a495dd3e16a55d5c82add2.zip
opensim-SC-d6b8b41a5b5683ca35a495dd3e16a55d5c82add2.tar.gz
opensim-SC-d6b8b41a5b5683ca35a495dd3e16a55d5c82add2.tar.bz2
opensim-SC-d6b8b41a5b5683ca35a495dd3e16a55d5c82add2.tar.xz
Applied Patch from mantis #3245. Thanks tlaukkan/Tommil
Diffstat (limited to 'OpenSim/Client/MXP/ClientStack/MXPClientView.cs')
-rw-r--r--OpenSim/Client/MXP/ClientStack/MXPClientView.cs428
1 files changed, 254 insertions, 174 deletions
diff --git a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
index db60622..0a9b6e6 100644
--- a/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
+++ b/OpenSim/Client/MXP/ClientStack/MXPClientView.cs
@@ -39,6 +39,7 @@ using OpenSim.Framework;
39using OpenSim.Framework.Client; 39using OpenSim.Framework.Client;
40using Packet=OpenMetaverse.Packets.Packet; 40using Packet=OpenMetaverse.Packets.Packet;
41using MXP.Extentions.OpenMetaverseFragments.Proto; 41using MXP.Extentions.OpenMetaverseFragments.Proto;
42using MXP.Util;
42 43
43namespace OpenSim.Client.MXP.ClientStack 44namespace OpenSim.Client.MXP.ClientStack
44{ 45{
@@ -46,44 +47,25 @@ namespace OpenSim.Client.MXP.ClientStack
46 { 47 {
47 internal static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 internal static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 49
50 #region Fields
49 private readonly Session m_session; 51 private readonly Session m_session;
50 private readonly UUID m_sessionID; 52 private readonly UUID m_sessionID;
51 private readonly UUID m_userID; 53 private readonly UUID m_userID;
52 private readonly IScene m_hostBubble; 54 private readonly IScene m_scene;
53 private readonly string m_firstName; 55 private readonly string m_firstName;
54 private readonly string m_lastName; 56 private readonly string m_lastName;
55 57
56 private Vector3 m_startPosition=new Vector3(128f, 128f, 128f); 58 private Vector3 m_startPosition=new Vector3(128f, 128f, 128f);
57 private int m_debugLevel; 59 private int m_debugLevel;
58 60 #endregion
59 61
60 public MXPClientView(Session mxpSession, UUID mxpSessionID, UUID userID, IScene mxpHostBubble, string mxpFirstName, string mxpLastName) 62 #region Properties
61 {
62 this.m_session = mxpSession;
63 this.m_userID = userID;
64 this.m_firstName = mxpFirstName;
65 this.m_lastName = mxpLastName;
66 this.m_hostBubble = mxpHostBubble;
67 this.m_sessionID = mxpSessionID;
68 }
69 63
70 public Session Session 64 public Session Session
71 { 65 {
72 get { return m_session; } 66 get { return m_session; }
73 } 67 }
74 68
75 public bool ProcessMXPPacket(Message msg)
76 {
77 if (m_debugLevel > 0)
78 {
79 m_log.Warn("[MXP] Received messaged unhandled: " + msg);
80 }
81
82 return false;
83 }
84
85 #region IClientAPI
86
87 public Vector3 StartPos 69 public Vector3 StartPos
88 { 70 {
89 get { return m_startPosition; } 71 get { return m_startPosition; }
@@ -142,7 +124,7 @@ namespace OpenSim.Client.MXP.ClientStack
142 124
143 public IScene Scene 125 public IScene Scene
144 { 126 {
145 get { return m_hostBubble; } 127 get { return m_scene; }
146 } 128 }
147 129
148 public int NextAnimationSequenceNumber 130 public int NextAnimationSequenceNumber
@@ -165,17 +147,228 @@ namespace OpenSim.Client.MXP.ClientStack
165 } 147 }
166 } 148 }
167 149
168 // Do we need this? 150 #endregion
169 public bool SendLogoutPacketWhenClosing 151
152 #region Constructors
153 public MXPClientView(Session mxpSession, UUID mxpSessionID, UUID userID, IScene mxpHostBubble, string mxpFirstName, string mxpLastName)
170 { 154 {
171 set { } 155 this.m_session = mxpSession;
156 this.m_userID = userID;
157 this.m_firstName = mxpFirstName;
158 this.m_lastName = mxpLastName;
159 this.m_scene = mxpHostBubble;
160 this.m_sessionID = mxpSessionID;
172 } 161 }
162 #endregion
173 163
174 public uint CircuitCode 164 #region MXP Incoming Message Processing
165
166 public bool ProcessMXPPacket(Message msg)
175 { 167 {
176 get { return m_sessionID.CRC(); } 168 if (m_debugLevel > 0)
169 {
170 m_log.Warn("[MXP] Received messaged unhandled: " + msg);
171 }
172
173 return false;
174 }
175
176 #endregion
177
178 #region MXP Outgoing Message Processing
179
180 private void MXPSendPrimitive(uint localID, UUID ownerID, Vector3 acc, Vector3 rvel, PrimitiveBaseShape primShape, Vector3 pos, UUID objectID, Vector3 vel, Quaternion rotation, uint flags, string text, byte[] textColor, uint parentID, byte[] particleSystem, byte clickAction, byte material, byte[] textureanim)
181 {
182 String typeName = ToOmType(primShape.PCode);
183 m_log.Info("[MXP] Transmitting Primitive" + typeName);
184
185 PerceptionEventMessage pe = new PerceptionEventMessage();
186
187 pe.ObjectFragment.ObjectId = objectID.Guid;
188 // TODO Resolve ParentID
189 pe.ObjectFragment.ParentObjectId = Guid.Empty;
190 pe.ObjectFragment.ObjectIndex = localID;
191 pe.ObjectFragment.ObjectName = typeName + " Object";
192 pe.ObjectFragment.OwnerId = ownerID.Guid;
193 pe.ObjectFragment.TypeId = Guid.Empty;
194 pe.ObjectFragment.TypeName = typeName;
195 pe.ObjectFragment.Acceleration = new float[] { acc.X, acc.Y, acc.Z };
196 pe.ObjectFragment.AngularAcceleration = new float[4];
197 pe.ObjectFragment.AngularVelocity = new float[] { rvel.X, rvel.Y, rvel.Z, 0.0f };
198 pe.ObjectFragment.BoundingSphereRadius = primShape.Scale.Length();
199
200 pe.ObjectFragment.Location = new float[] { pos.X, pos.Y, pos.Z };
201
202 pe.ObjectFragment.Mass = 1.0f;
203 pe.ObjectFragment.Orientation = new float[] { rotation.X, rotation.Y, rotation.Z, rotation.W };
204 pe.ObjectFragment.Velocity = new float[] { vel.X, vel.Y, vel.Z };
205
206 OmSlPrimitiveExt ext = new OmSlPrimitiveExt();
207
208 if (!((primShape.PCode == (byte)PCode.NewTree) || (primShape.PCode == (byte)PCode.Tree) || (primShape.PCode == (byte)PCode.Grass)))
209 {
210
211 ext.PathBegin = primShape.PathBegin;
212 ext.PathEnd = primShape.PathEnd;
213 ext.PathScaleX = primShape.PathScaleX;
214 ext.PathScaleY = primShape.PathScaleY;
215 ext.PathShearX = primShape.PathShearX;
216 ext.PathShearY = primShape.PathShearY;
217 ext.PathSkew = primShape.PathSkew;
218 ext.ProfileBegin = primShape.ProfileBegin;
219 ext.ProfileEnd = primShape.ProfileEnd;
220 ext.PathCurve = primShape.PathCurve;
221 ext.ProfileCurve = primShape.ProfileCurve;
222 ext.ProfileHollow = primShape.ProfileHollow;
223 ext.PathRadiusOffset = primShape.PathRadiusOffset;
224 ext.PathRevolutions = primShape.PathRevolutions;
225 ext.PathTaperX = primShape.PathTaperX;
226 ext.PathTaperY = primShape.PathTaperY;
227 ext.PathTwist = primShape.PathTwist;
228 ext.PathTwistBegin = primShape.PathTwistBegin;
229
230
231 }
232
233 ext.UpdateFlags = flags;
234 ext.ExtraParams = primShape.ExtraParams;
235 ext.State = primShape.State;
236 ext.TextureEntry = primShape.TextureEntry;
237 ext.TextureAnim = textureanim;
238 ext.Scale = ToOmVector(primShape.Scale);
239 ext.Text = text;
240 ext.TextColor = ToOmColor(textColor);
241 ext.PSBlock = particleSystem;
242 ext.ClickAction = clickAction;
243 ext.Material = material;
244
245 pe.SetExtension<OmSlPrimitiveExt>(ext);
246
247 Session.Send(pe);
248 }
249
250 public void MXPSendAvatarData(string participantName, UUID ownerID, UUID parentId, UUID avatarID, uint avatarLocalID, Vector3 position, Quaternion rotation)
251 {
252 m_log.Info("[MXP] Transmitting Avatar Data " + participantName);
253
254 PerceptionEventMessage pe = new PerceptionEventMessage();
255
256 pe.ObjectFragment.ObjectId = avatarID.Guid;
257 // TODO Resolve ParentID
258 pe.ObjectFragment.ParentObjectId = parentId.Guid;
259 pe.ObjectFragment.ObjectIndex = avatarLocalID;
260 pe.ObjectFragment.ObjectName = participantName;
261 pe.ObjectFragment.OwnerId = ownerID.Guid;
262 pe.ObjectFragment.TypeId = Guid.Empty;
263 pe.ObjectFragment.TypeName = "Avatar";
264 pe.ObjectFragment.Acceleration = new float[3];
265 pe.ObjectFragment.AngularAcceleration = new float[4];
266 pe.ObjectFragment.AngularVelocity = new float[4];
267 pe.ObjectFragment.BoundingSphereRadius = 1; // TODO Fill in appropriate value
268
269 pe.ObjectFragment.Location = new float[] { position.X, position.Y, position.Z };
270
271 pe.ObjectFragment.Mass = 1.0f; // TODO Fill in appropriate value
272 pe.ObjectFragment.Orientation = new float[] { rotation.X, rotation.Y, rotation.Z, rotation.W };
273 pe.ObjectFragment.Velocity = new float[3];
274
275 Session.Send(pe);
276 }
277
278 public void MXPSendTerrain(float[] map)
279 {
280 m_log.Info("[MXP] Transmitting terrain for " + m_scene.RegionInfo.RegionName);
281
282 PerceptionEventMessage pe = new PerceptionEventMessage();
283
284 // Hacking terrain object uuid to zero and index to hashcode of regionuuid
285 pe.ObjectFragment.ObjectId = m_scene.RegionInfo.RegionSettings.RegionUUID.Guid;
286 pe.ObjectFragment.ObjectIndex = (uint)(m_scene.RegionInfo.RegionSettings.RegionUUID.GetHashCode() + ((long)int.MaxValue) / 2);
287 pe.ObjectFragment.ParentObjectId = UUID.Zero.Guid;
288 pe.ObjectFragment.ObjectName = "Terrain of " + m_scene.RegionInfo.RegionName;
289 pe.ObjectFragment.OwnerId = m_scene.RegionInfo.MasterAvatarAssignedUUID.Guid;
290 pe.ObjectFragment.TypeId = Guid.Empty;
291 pe.ObjectFragment.TypeName = "Terrain";
292 pe.ObjectFragment.Acceleration = new float[3];
293 pe.ObjectFragment.AngularAcceleration = new float[4];
294 pe.ObjectFragment.AngularVelocity = new float[4];
295 pe.ObjectFragment.BoundingSphereRadius = 1; // TODO Fill in appropriate value
296
297 pe.ObjectFragment.Location = new float[] { 0, 0, 0 };
298
299 pe.ObjectFragment.Mass = 1.0f; // TODO Fill in appropriate value
300 pe.ObjectFragment.Orientation = new float[] { 0, 0, 0, 0 };
301 pe.ObjectFragment.Velocity = new float[3];
302
303 OmBitmapTerrainExt terrainExt = new OmBitmapTerrainExt();
304 terrainExt.Width = 256;
305 terrainExt.Height = 256;
306 terrainExt.WaterLevel = (float) m_scene.RegionInfo.RegionSettings.WaterHeight;
307 terrainExt.Offset = 0;
308 terrainExt.Scale = 10;
309 terrainExt.HeightMap = CompressionUtil.CompressHeightMap(map, 0, 10);
310
311 pe.SetExtension<OmBitmapTerrainExt>(terrainExt);
312
313 Session.Send(pe);
314 }
315
316 #endregion
317
318 #region MXP Conversions
319
320 private OmVector3f ToOmVector(Vector3 value)
321 {
322 OmVector3f encodedValue = new OmVector3f();
323 encodedValue.X = value.X;
324 encodedValue.Y = value.Y;
325 encodedValue.Z = value.Z;
326 return encodedValue;
327 }
328
329 private OmColor4f ToOmColor(byte[] value)
330 {
331 OmColor4f encodedValue = new OmColor4f();
332 encodedValue.R = value[0];
333 encodedValue.G = value[1];
334 encodedValue.B = value[2];
335 encodedValue.A = value[3];
336 return encodedValue;
337 }
338
339 private string ToOmType(byte value)
340 {
341 if (value == (byte)PCodeEnum.Avatar)
342 {
343 return "Avatar";
344 }
345 if (value == (byte)PCodeEnum.Grass)
346 {
347 return "Grass";
348 }
349 if (value == (byte)PCodeEnum.NewTree)
350 {
351 return "NewTree";
352 }
353 if (value == (byte)PCodeEnum.ParticleSystem)
354 {
355 return "ParticleSystem";
356 }
357 if (value == (byte)PCodeEnum.Primitive)
358 {
359 return "Primitive";
360 }
361 if (value == (byte)PCodeEnum.Tree)
362 {
363 return "Tree";
364 }
365 throw new Exception("Unsupported PCode value: " + value);
177 } 366 }
178 367
368 #endregion
369
370 #region OpenSim Event Handlers
371
179 public event GenericMessage OnGenericMessage; 372 public event GenericMessage OnGenericMessage;
180 public event ImprovedInstantMessage OnInstantMessage; 373 public event ImprovedInstantMessage OnInstantMessage;
181 public event ChatMessage OnChatFromClient; 374 public event ChatMessage OnChatFromClient;
@@ -354,6 +547,20 @@ namespace OpenSim.Client.MXP.ClientStack
354 public event UserInfoRequest OnUserInfoRequest; 547 public event UserInfoRequest OnUserInfoRequest;
355 public event UpdateUserInfo OnUpdateUserInfo; 548 public event UpdateUserInfo OnUpdateUserInfo;
356 549
550 #endregion
551
552 #region OpenSim ClientView Public Methods
553 // Do we need this?
554 public bool SendLogoutPacketWhenClosing
555 {
556 set { }
557 }
558
559 public uint CircuitCode
560 {
561 get { return m_sessionID.CRC(); }
562 }
563
357 public void SetDebugPacketLevel(int newDebug) 564 public void SetDebugPacketLevel(int newDebug)
358 { 565 {
359 m_debugLevel = newDebug; 566 m_debugLevel = newDebug;
@@ -402,6 +609,18 @@ namespace OpenSim.Client.MXP.ClientStack
402 public void Start() 609 public void Start()
403 { 610 {
404 Scene.AddNewClient(this); 611 Scene.AddNewClient(this);
612 /*foreach (ScenePresence presence in ((Scene)Scene).GetScenePresences())
613 {
614 if (presence.Appearance!=null)
615 {
616 AvatarAppearance avatar = presence.Appearance;
617 if (presence.Appearance.Owner == m_userID)
618 {
619 MXPSendAvatarData(m_firstName + " " + m_lastName, presence.Appearance.Owner, UUID.Zero, presence.UUID, presence.LocalId, presence.AbsolutePosition, presence.Rotation);
620 }
621 }
622 }*/
623
405 } 624 }
406 625
407 public void Stop() 626 public void Stop()
@@ -484,12 +703,11 @@ namespace OpenSim.Client.MXP.ClientStack
484 703
485 public void SendLayerData(float[] map) 704 public void SendLayerData(float[] map)
486 { 705 {
487 // Need to translate to MXP somehow 706 MXPSendTerrain(map);
488 } 707 }
489 708
490 public void SendLayerData(int px, int py, float[] map) 709 public void SendLayerData(int px, int py, float[] map)
491 { 710 {
492 // Need to translate to MXP somehow
493 } 711 }
494 712
495 public void SendWindData(Vector2[] windSpeeds) 713 public void SendWindData(Vector2[] windSpeeds)
@@ -568,32 +786,11 @@ namespace OpenSim.Client.MXP.ClientStack
568 // Need to translate to MXP somehow 786 // Need to translate to MXP somehow
569 } 787 }
570 788
571 public void SendAvatarData(ulong regionHandle, string firstName, string lastName, string grouptitle, UUID avatarID, uint avatarLocalID, Vector3 pos, byte[] textureEntry, uint parentID, Quaternion rotation) 789 public void SendAvatarData(ulong regionHandle, string firstName, string lastName, string grouptitle, UUID avatarID, uint avatarLocalID, Vector3 position, byte[] textureEntry, uint parentID, Quaternion rotation)
572 { 790 {
573 m_log.Info("[MXP] Transmitting Avatar Data " + firstName + " " + lastName); 791 //ScenePresence presence=((Scene)this.Scene).GetScenePresence(avatarID);
574 792 UUID ownerID = avatarID;
575 PerceptionEventMessage pe = new PerceptionEventMessage(); 793 MXPSendAvatarData(firstName + " " + lastName, ownerID, UUID.Zero, avatarID, avatarLocalID, position, rotation);
576
577 pe.ObjectFragment.ObjectId = avatarID.Guid;
578 // TODO Resolve ParentID
579 pe.ObjectFragment.ParentObjectId = Guid.Empty;
580 pe.ObjectFragment.ObjectIndex = avatarLocalID;
581 pe.ObjectFragment.ObjectName = firstName+" "+lastName;
582 pe.ObjectFragment.OwnerId = Guid.Empty;
583 pe.ObjectFragment.TypeId = Guid.Empty;
584 pe.ObjectFragment.TypeName = "Avatar";
585 pe.ObjectFragment.Acceleration = new float[3];
586 pe.ObjectFragment.AngularAcceleration = new float[4];
587 pe.ObjectFragment.AngularVelocity = new float[4];
588 pe.ObjectFragment.BoundingSphereRadius = 1; // TODO Fill in appropriate value
589
590 pe.ObjectFragment.Location = new float[] { pos.X, pos.Y, pos.Z };
591
592 pe.ObjectFragment.Mass = 1.0f; // TODO Fill in appropriate value
593 pe.ObjectFragment.Orientation = new float[] { rotation.X, rotation.Y, rotation.Z, rotation.W };
594 pe.ObjectFragment.Velocity = new float[3];
595
596 Session.Send(pe);
597 } 794 }
598 795
599 public void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, Vector3 position, Vector3 velocity, Quaternion rotation) 796 public void SendAvatarTerseUpdate(ulong regionHandle, ushort timeDilation, uint localID, Vector3 position, Vector3 velocity, Quaternion rotation)
@@ -626,124 +823,6 @@ namespace OpenSim.Client.MXP.ClientStack
626 MXPSendPrimitive(localID, ownerID, acc, rvel, primShape, pos, objectID, vel, rotation, flags,text,color,parentID,particleSystem,clickAction,material,textureanim); 823 MXPSendPrimitive(localID, ownerID, acc, rvel, primShape, pos, objectID, vel, rotation, flags,text,color,parentID,particleSystem,clickAction,material,textureanim);
627 } 824 }
628 825
629 private void MXPSendPrimitive(uint localID, UUID ownerID, Vector3 acc, Vector3 rvel, PrimitiveBaseShape primShape, Vector3 pos, UUID objectID, Vector3 vel, Quaternion rotation, uint flags, string text, byte[] textColor, uint parentID, byte[] particleSystem, byte clickAction, byte material, byte[] textureanim)
630 {
631 String typeName = PCodeToString(primShape.PCode);
632 m_log.Info("[MXP] Transmitting Primitive" + typeName);
633
634 PerceptionEventMessage pe = new PerceptionEventMessage();
635
636 pe.ObjectFragment.ObjectId = objectID.Guid;
637 // TODO Resolve ParentID
638 pe.ObjectFragment.ParentObjectId = Guid.Empty;
639 pe.ObjectFragment.ObjectIndex = localID;
640 pe.ObjectFragment.ObjectName = typeName + " Object";
641 pe.ObjectFragment.OwnerId = ownerID.Guid;
642 pe.ObjectFragment.TypeId = Guid.Empty;
643 pe.ObjectFragment.TypeName = typeName;
644 pe.ObjectFragment.Acceleration = new float[] { acc.X, acc.Y, acc.Z };
645 pe.ObjectFragment.AngularAcceleration = new float[4];
646 pe.ObjectFragment.AngularVelocity = new float[] { rvel.X, rvel.Y, rvel.Z, 0.0f };
647 pe.ObjectFragment.BoundingSphereRadius = primShape.Scale.Length();
648
649 pe.ObjectFragment.Location = new float[] { pos.X , pos.Y, pos.Z };
650
651 pe.ObjectFragment.Mass = 1.0f;
652 pe.ObjectFragment.Orientation = new float[] { rotation.X, rotation.Y, rotation.Z, rotation.W };
653 pe.ObjectFragment.Velocity = new float[] { vel.X, vel.Y, vel.Z };
654
655 ObjectExtFragment ext = new ObjectExtFragment();
656
657 if (!((primShape.PCode == (byte)PCode.NewTree) || (primShape.PCode == (byte)PCode.Tree) || (primShape.PCode == (byte)PCode.Grass)))
658 {
659
660 ext.PathBegin = primShape.PathBegin;
661 ext.PathEnd = primShape.PathEnd;
662 ext.PathScaleX = primShape.PathScaleX;
663 ext.PathScaleY = primShape.PathScaleY;
664 ext.PathShearX = primShape.PathShearX;
665 ext.PathShearY = primShape.PathShearY;
666 ext.PathSkew = primShape.PathSkew;
667 ext.ProfileBegin = primShape.ProfileBegin;
668 ext.ProfileEnd = primShape.ProfileEnd;
669 ext.PathCurve = primShape.PathCurve;
670 ext.ProfileCurve = primShape.ProfileCurve;
671 ext.ProfileHollow = primShape.ProfileHollow;
672 ext.PathRadiusOffset = primShape.PathRadiusOffset;
673 ext.PathRevolutions = primShape.PathRevolutions;
674 ext.PathTaperX = primShape.PathTaperX;
675 ext.PathTaperY = primShape.PathTaperY;
676 ext.PathTwist = primShape.PathTwist;
677 ext.PathTwistBegin = primShape.PathTwistBegin;
678
679
680 }
681
682 ext.UpdateFlags = flags;
683 ext.ExtraParams = primShape.ExtraParams;
684 ext.State = primShape.State;
685 ext.TextureEntry = primShape.TextureEntry;
686 ext.TextureAnim = textureanim;
687 ext.Scale = EncodeVector(primShape.Scale);
688 ext.Text = text;
689 ext.TextColor = EncodeColor(textColor);
690 ext.PSBlock = particleSystem;
691 ext.ClickAction = clickAction;
692 ext.Material = material;
693
694 pe.SetExtension<ObjectExtFragment>(ext);
695
696 Session.Send(pe);
697 }
698
699 private vectorf EncodeVector(Vector3 value)
700 {
701 vectorf encodedValue=new vectorf();
702 encodedValue.X=value.X;
703 encodedValue.Y=value.Y;
704 encodedValue.Z=value.Z;
705 return encodedValue;
706 }
707
708 private color EncodeColor(byte[] value)
709 {
710 color encodedValue = new color();
711 encodedValue.R = value[0];
712 encodedValue.G = value[1];
713 encodedValue.B = value[2];
714 encodedValue.A = value[3];
715 return encodedValue;
716 }
717
718 private string PCodeToString(byte value)
719 {
720 if(value==(byte)PCodeEnum.Avatar)
721 {
722 return "Avatar";
723 }
724 if (value == (byte)PCodeEnum.Grass)
725 {
726 return "Grass";
727 }
728 if (value == (byte)PCodeEnum.NewTree)
729 {
730 return "NewTree";
731 }
732 if (value == (byte)PCodeEnum.ParticleSystem)
733 {
734 return "ParticleSystem";
735 }
736 if (value == (byte)PCodeEnum.Primitive)
737 {
738 return "Primitive";
739 }
740 if (value == (byte)PCodeEnum.Tree)
741 {
742 return "Tree";
743 }
744 throw new Exception("Unsupported PCode value: "+value);
745 }
746
747 public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, Vector3 pos, Vector3 vel, Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags, UUID objectID, UUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, byte clickAction, byte material) 826 public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, Vector3 pos, Vector3 vel, Vector3 acc, Quaternion rotation, Vector3 rvel, uint flags, UUID objectID, UUID ownerID, string text, byte[] color, uint parentID, byte[] particleSystem, byte clickAction, byte material)
748 { 827 {
749 MXPSendPrimitive(localID, ownerID, acc, rvel, primShape, pos, objectID, vel, rotation, flags, text, color, parentID, particleSystem, clickAction, material, new byte[0]); 828 MXPSendPrimitive(localID, ownerID, acc, rvel, primShape, pos, objectID, vel, rotation, flags, text, color, parentID, particleSystem, clickAction, material, new byte[0]);
@@ -1323,5 +1402,6 @@ namespace OpenSim.Client.MXP.ClientStack
1323 } 1402 }
1324 1403
1325 #endregion 1404 #endregion
1405
1326 } 1406 }
1327} 1407}