aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectPart.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs101
1 files changed, 93 insertions, 8 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 1cfe9c8..c8a7515 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -31,7 +31,7 @@ namespace OpenSim.Region.Environment.Scenes
31 public uint GroupMask = FULL_MASK_PERMISSIONS; 31 public uint GroupMask = FULL_MASK_PERMISSIONS;
32 public uint EveryoneMask = FULL_MASK_PERMISSIONS; 32 public uint EveryoneMask = FULL_MASK_PERMISSIONS;
33 public uint BaseMask = FULL_MASK_PERMISSIONS; 33 public uint BaseMask = FULL_MASK_PERMISSIONS;
34 34
35 protected byte[] m_particleSystem = new byte[0]; 35 protected byte[] m_particleSystem = new byte[0];
36 36
37 protected SceneObjectGroup m_parentGroup; 37 protected SceneObjectGroup m_parentGroup;
@@ -47,7 +47,7 @@ namespace OpenSim.Region.Environment.Scenes
47 public LLUUID UUID 47 public LLUUID UUID
48 { 48 {
49 get { return m_uuid; } 49 get { return m_uuid; }
50 set { m_uuid = value ; } 50 set { m_uuid = value; }
51 } 51 }
52 52
53 protected uint m_localID; 53 protected uint m_localID;
@@ -64,7 +64,7 @@ namespace OpenSim.Region.Environment.Scenes
64 set { m_name = value; } 64 set { m_name = value; }
65 } 65 }
66 66
67 protected LLObject.ObjectFlags m_flags = (LLObject.ObjectFlags)32 + 65536 + 131072 + 256 + 4 + 8 + 2048 + 524288 + 268435456 + 128; 67 protected LLObject.ObjectFlags m_flags = (LLObject.ObjectFlags)32 + 65536 + 131072 + 256 + 4 + 8 + 268435456 + 128;
68 public uint ObjectFlags 68 public uint ObjectFlags
69 { 69 {
70 get { return (uint)m_flags; } 70 get { return (uint)m_flags; }
@@ -221,7 +221,6 @@ namespace OpenSim.Region.Environment.Scenes
221 this.AngularVelocity = new LLVector3(0, 0, 0); 221 this.AngularVelocity = new LLVector3(0, 0, 0);
222 this.Acceleration = new LLVector3(0, 0, 0); 222 this.Acceleration = new LLVector3(0, 0, 0);
223 223
224
225 224
226 //temporary code just so the m_flags field doesn't give a compiler warning 225 //temporary code just so the m_flags field doesn't give a compiler warning
227 if (m_flags == LLObject.ObjectFlags.AllowInventoryDrop) 226 if (m_flags == LLObject.ObjectFlags.AllowInventoryDrop)
@@ -233,6 +232,7 @@ namespace OpenSim.Region.Environment.Scenes
233 232
234 /// <summary> 233 /// <summary>
235 /// Re/create a SceneObjectPart (prim) 234 /// Re/create a SceneObjectPart (prim)
235 /// currently not used, and maybe won't be
236 /// </summary> 236 /// </summary>
237 /// <param name="regionHandle"></param> 237 /// <param name="regionHandle"></param>
238 /// <param name="parent"></param> 238 /// <param name="parent"></param>
@@ -396,13 +396,59 @@ namespace OpenSim.Region.Environment.Scenes
396 #endregion 396 #endregion
397 397
398 #region Inventory 398 #region Inventory
399 public void GetInventory(IClientAPI client, uint localID) 399 /// <summary>
400 ///
401 /// </summary>
402 /// <param name="client"></param>
403 /// <param name="localID"></param>
404 public void GetInventoryFileName(IClientAPI client, uint localID)
400 { 405 {
401 if (localID == this.m_localID) 406 if (localID == this.m_localID)
402 { 407 {
408 // client.SendTaskInventory(this.m_uuid, 0, Helpers.StringToField("primInventory"));
403 client.SendTaskInventory(this.m_uuid, 0, new byte[0]); 409 client.SendTaskInventory(this.m_uuid, 0, new byte[0]);
404 } 410 }
405 } 411 }
412
413 /// <summary>
414 ///
415 /// </summary>
416 /// <param name="client"></param>
417 /// <param name="xferID"></param>
418 public void RequestInventoryFile(IClientAPI client, ulong xferID)
419 {
420 // a test item
421 InventoryStringBuilder invString = new InventoryStringBuilder();
422 invString.AddItemStart();
423 invString.AddNameValueLine("item_id", LLUUID.Random().ToStringHyphenated());
424 invString.AddNameValueLine("parent_id", this.UUID.ToStringHyphenated());
425
426 invString.AddPermissionsStart();
427 invString.AddNameValueLine("base_mask", "0x7FFFFFFF");
428 invString.AddNameValueLine("owner_mask", "0x7FFFFFFF");
429 invString.AddNameValueLine("group_mask", "0x7FFFFFFF");
430 invString.AddNameValueLine("everyone_mask", "0x7FFFFFFF");
431 invString.AddNameValueLine("next_owner_mask", "0x7FFFFFFF");
432 invString.AddNameValueLine("creator_id", client.AgentId.ToStringHyphenated());
433 invString.AddNameValueLine("owner_id", client.AgentId.ToStringHyphenated());
434 invString.AddNameValueLine("last_owner_id", LLUUID.Zero.ToStringHyphenated());
435 invString.AddNameValueLine("group_id", LLUUID.Zero.ToStringHyphenated());
436 invString.AddSectionEnd();
437
438 invString.AddNameValueLine("asset_id", "00000000-0000-0000-9999-000000000002");
439 invString.AddNameValueLine("type", "texture");
440 invString.AddNameValueLine("inv_type" , "texture");
441 invString.AddNameValueLine("flags", "0x00");
442 invString.AddNameValueLine("name", "Test inventory" + "|");
443 invString.AddNameValueLine("desc", "test description" + "|");
444 invString.AddNameValueLine("creation_date", "10000");
445 invString.AddSectionEnd();
446
447 byte[] fileInv = Helpers.StringToField(invString.BuildString);
448 byte[] data = new byte[fileInv.Length + 4];
449 Array.Copy(fileInv, 0,data , 4, fileInv.Length);
450 client.SendXferPacket(xferID, 0 + 0x80000000, data);
451 }
406 #endregion 452 #endregion
407 453
408 #region ExtraParams 454 #region ExtraParams
@@ -422,7 +468,7 @@ namespace OpenSim.Region.Environment.Scenes
422 Array.Copy(data, 0, this.m_shape.ExtraParams, i, data.Length); 468 Array.Copy(data, 0, this.m_shape.ExtraParams, i, data.Length);
423 469
424 this.ScheduleFullUpdate(); 470 this.ScheduleFullUpdate();
425 471
426 } 472 }
427 #endregion 473 #endregion
428 474
@@ -497,7 +543,7 @@ namespace OpenSim.Region.Environment.Scenes
497 /// <param name="remoteClient"></param> 543 /// <param name="remoteClient"></param>
498 public void SendFullUpdate(IClientAPI remoteClient) 544 public void SendFullUpdate(IClientAPI remoteClient)
499 { 545 {
500 m_parentGroup.SendPartFullUpdate( remoteClient, this ); 546 m_parentGroup.SendPartFullUpdate(remoteClient, this);
501 } 547 }
502 548
503 /// <summary> 549 /// <summary>
@@ -580,7 +626,46 @@ namespace OpenSim.Region.Environment.Scenes
580 626
581 public void SetText(string text, Vector3 color, double alpha) 627 public void SetText(string text, Vector3 color, double alpha)
582 { 628 {
583 Text = text; 629 Text = text;
630 }
631
632 public class InventoryStringBuilder
633 {
634 public string BuildString = "";
635
636 public InventoryStringBuilder()
637 {
638
639 }
640
641 public void AddItemStart()
642 {
643 BuildString += "\tinv_item\t0\n";
644 BuildString += "\t{\n";
645 }
646
647 public void AddPermissionsStart()
648 {
649 BuildString += "\tpermissions 0\n";
650 BuildString += "\t{\n";
651 }
652
653 public void AddSectionEnd()
654 {
655 BuildString += "\t}\n";
656 }
657
658 public void AddLine(string addLine)
659 {
660 BuildString += addLine;
661 }
662
663 public void AddNameValueLine(string name, string value)
664 {
665 BuildString += "\t\t";
666 BuildString += name + "\t";
667 BuildString += value + "\n";
668 }
584 } 669 }
585 } 670 }
586} 671}