aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/ClientView.API.cs
diff options
context:
space:
mode:
authorMW2007-08-19 13:35:20 +0000
committerMW2007-08-19 13:35:20 +0000
commitc89db49f3cd3bbd60577eb5a1787ccf8dea930e3 (patch)
tree2b51b0d261724427933f543dd2f39ef8cd21127f /OpenSim/Region/ClientStack/ClientView.API.cs
parentCode comments on recent changes in EventQueueManager (diff)
downloadopensim-SC-c89db49f3cd3bbd60577eb5a1787ccf8dea930e3.zip
opensim-SC-c89db49f3cd3bbd60577eb5a1787ccf8dea930e3.tar.gz
opensim-SC-c89db49f3cd3bbd60577eb5a1787ccf8dea930e3.tar.bz2
opensim-SC-c89db49f3cd3bbd60577eb5a1787ccf8dea930e3.tar.xz
Sqlite datastore should now save the textures and extraparams data (used by sculpties) correctly. [Really need to add a ExtraParams field to the sqlite database though, but for now I have combined their data so that we don't lose backward compatibility, know a couple of people have been using the datastore already].
Now have a rough day/night cycle (the movement of the sun needs to be made smoother but for now it is better than we had I think). Added dalien's patch (issue 294) for saving and loading prims to a xml file (think he will be modifying these to be import/export functions and maybe writing a xml datastore for backups). Some preliminary work on task inventory (ie object's/prim's inventory). Added place holder data for AvatarProperties (ie a avatar's profile). Should we store this sort of data on the user server or have another server for it (a normal webserver should work). Added a few more method to IClientAPI. Sure there is something I'm forgeting.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ClientStack/ClientView.API.cs126
1 files changed, 98 insertions, 28 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs
index f655674..c67ecb5 100644
--- a/OpenSim/Region/ClientStack/ClientView.API.cs
+++ b/OpenSim/Region/ClientStack/ClientView.API.cs
@@ -74,9 +74,9 @@ namespace OpenSim.Region.ClientStack
74 public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation; 74 public event UpdatePrimSingleRotation OnUpdatePrimSingleRotation;
75 public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation; 75 public event UpdatePrimGroupRotation OnUpdatePrimGroupMouseRotation;
76 public event UpdateVector OnUpdatePrimScale; 76 public event UpdateVector OnUpdatePrimScale;
77 public event StatusChange OnChildAgentStatus; 77 public event StatusChange OnChildAgentStatus;
78 public event GenericCall2 OnStopMovement; 78 public event GenericCall2 OnStopMovement;
79 public event GenericCall6 OnRemoveAvatar; 79 public event GenericCall6 OnRemoveAvatar;
80 public event RequestMapBlocks OnRequestMapBlocks; 80 public event RequestMapBlocks OnRequestMapBlocks;
81 public event TeleportLocationRequest OnTeleportLocationRequest; 81 public event TeleportLocationRequest OnTeleportLocationRequest;
82 public event DisconnectUser OnDisconnectUser; 82 public event DisconnectUser OnDisconnectUser;
@@ -88,6 +88,7 @@ namespace OpenSim.Region.ClientStack
88 public event RequestTaskInventory OnRequestTaskInventory; 88 public event RequestTaskInventory OnRequestTaskInventory;
89 public event UDPAssetUploadRequest OnAssetUploadRequest; 89 public event UDPAssetUploadRequest OnAssetUploadRequest;
90 public event XferReceive OnXferReceive; 90 public event XferReceive OnXferReceive;
91 public event RequestXfer OnRequestXfer;
91 92
92 public event UUIDNameRequest OnNameFromUUIDRequest; 93 public event UUIDNameRequest OnNameFromUUIDRequest;
93 94
@@ -410,7 +411,7 @@ namespace OpenSim.Region.ClientStack
410 newSimPack.RegionData.SimPort = (ushort)externalIPEndPoint.Port; 411 newSimPack.RegionData.SimPort = (ushort)externalIPEndPoint.Port;
411 //newSimPack.RegionData.SeedCapability = new byte[0]; 412 //newSimPack.RegionData.SeedCapability = new byte[0];
412 newSimPack.RegionData.SeedCapability = Helpers.StringToField(capsURL); 413 newSimPack.RegionData.SeedCapability = Helpers.StringToField(capsURL);
413 414
414 this.OutPacket(newSimPack); 415 this.OutPacket(newSimPack);
415 } 416 }
416 417
@@ -463,7 +464,7 @@ namespace OpenSim.Region.ClientStack
463 ip += (uint)byteIP[2] << 16; 464 ip += (uint)byteIP[2] << 16;
464 ip += (uint)byteIP[1] << 8; 465 ip += (uint)byteIP[1] << 8;
465 ip += (uint)byteIP[0]; 466 ip += (uint)byteIP[0];
466 467
467 teleport.Info.SimIP = ip; 468 teleport.Info.SimIP = ip;
468 teleport.Info.SimPort = (ushort)newRegionEndPoint.Port; 469 teleport.Info.SimPort = (ushort)newRegionEndPoint.Port;
469 teleport.Info.LocationID = 4; 470 teleport.Info.LocationID = 4;
@@ -510,9 +511,9 @@ namespace OpenSim.Region.ClientStack
510 pc.PingID.PingID = seq; 511 pc.PingID.PingID = seq;
511 pc.Header.Reliable = false; 512 pc.Header.Reliable = false;
512 OutPacket(pc); 513 OutPacket(pc);
513 514
514 } 515 }
515 516
516 public void SendKillObject(ulong regionHandle, uint localID) 517 public void SendKillObject(ulong regionHandle, uint localID)
517 { 518 {
518 KillObjectPacket kill = new KillObjectPacket(); 519 KillObjectPacket kill = new KillObjectPacket();
@@ -526,7 +527,7 @@ namespace OpenSim.Region.ClientStack
526 { 527 {
527 Encoding enc = Encoding.ASCII; 528 Encoding enc = Encoding.ASCII;
528 uint FULL_MASK_PERMISSIONS = 2147483647; 529 uint FULL_MASK_PERMISSIONS = 2147483647;
529 InventoryDescendentsPacket descend = new InventoryDescendentsPacket(); 530 InventoryDescendentsPacket descend = new InventoryDescendentsPacket();
530 descend.AgentData.AgentID = this.AgentId; 531 descend.AgentData.AgentID = this.AgentId;
531 descend.AgentData.OwnerID = ownerID; 532 descend.AgentData.OwnerID = ownerID;
532 descend.AgentData.FolderID = folderID; 533 descend.AgentData.FolderID = folderID;
@@ -542,22 +543,22 @@ namespace OpenSim.Region.ClientStack
542 descend.ItemData[i].CreatorID = item.creatorsID; 543 descend.ItemData[i].CreatorID = item.creatorsID;
543 descend.ItemData[i].BaseMask = item.inventoryBasePermissions; 544 descend.ItemData[i].BaseMask = item.inventoryBasePermissions;
544 descend.ItemData[i].CreationDate = 1000; 545 descend.ItemData[i].CreationDate = 1000;
545 descend.ItemData[i].Description = enc.GetBytes(item.inventoryDescription+ "\0"); 546 descend.ItemData[i].Description = enc.GetBytes(item.inventoryDescription + "\0");
546 descend.ItemData[i].EveryoneMask = item.inventoryEveryOnePermissions; 547 descend.ItemData[i].EveryoneMask = item.inventoryEveryOnePermissions;
547 descend.ItemData[i].Flags = 1; 548 descend.ItemData[i].Flags = 1;
548 descend.ItemData[i].FolderID = item.parentFolderID; 549 descend.ItemData[i].FolderID = item.parentFolderID;
549 descend.ItemData[i].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); 550 descend.ItemData[i].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
550 descend.ItemData[i].GroupMask = 0; 551 descend.ItemData[i].GroupMask = 0;
551 descend.ItemData[i].InvType = (sbyte)item.invType; 552 descend.ItemData[i].InvType = (sbyte)item.invType;
552 descend.ItemData[i].Name = enc.GetBytes(item.inventoryName+ "\0"); 553 descend.ItemData[i].Name = enc.GetBytes(item.inventoryName + "\0");
553 descend.ItemData[i].NextOwnerMask = item.inventoryNextPermissions; 554 descend.ItemData[i].NextOwnerMask = item.inventoryNextPermissions;
554 descend.ItemData[i].OwnerID = item.avatarID; 555 descend.ItemData[i].OwnerID = item.avatarID;
555 descend.ItemData[i].OwnerMask = item.inventoryCurrentPermissions; 556 descend.ItemData[i].OwnerMask = item.inventoryCurrentPermissions;
556 descend.ItemData[i].SalePrice = 0; 557 descend.ItemData[i].SalePrice = 0;
557 descend.ItemData[i].SaleType = 0; 558 descend.ItemData[i].SaleType = 0;
558 descend.ItemData[i].Type = (sbyte)item.assetType; 559 descend.ItemData[i].Type = (sbyte)item.assetType;
559 descend.ItemData[i].CRC = Helpers.InventoryCRC(1000, 0, descend.ItemData[i].InvType, descend.ItemData[i].Type, descend.ItemData[i].AssetID, descend.ItemData[i].GroupID, 100,descend.ItemData[i].OwnerID, descend.ItemData[i].CreatorID, descend.ItemData[i].ItemID, descend.ItemData[i].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS); 560 descend.ItemData[i].CRC = Helpers.InventoryCRC(1000, 0, descend.ItemData[i].InvType, descend.ItemData[i].Type, descend.ItemData[i].AssetID, descend.ItemData[i].GroupID, 100, descend.ItemData[i].OwnerID, descend.ItemData[i].CreatorID, descend.ItemData[i].ItemID, descend.ItemData[i].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS);
560 561
561 i++; 562 i++;
562 } 563 }
563 564
@@ -617,14 +618,14 @@ namespace OpenSim.Region.ClientStack
617 InventoryReply.InventoryData[0].FolderID = Item.parentFolderID; 618 InventoryReply.InventoryData[0].FolderID = Item.parentFolderID;
618 InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); 619 InventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000");
619 InventoryReply.InventoryData[0].GroupMask = 0; 620 InventoryReply.InventoryData[0].GroupMask = 0;
620 InventoryReply.InventoryData[0].InvType =(sbyte) Item.invType; 621 InventoryReply.InventoryData[0].InvType = (sbyte)Item.invType;
621 InventoryReply.InventoryData[0].Name = enc.GetBytes(Item.inventoryName + "\0"); 622 InventoryReply.InventoryData[0].Name = enc.GetBytes(Item.inventoryName + "\0");
622 InventoryReply.InventoryData[0].NextOwnerMask = Item.inventoryNextPermissions; 623 InventoryReply.InventoryData[0].NextOwnerMask = Item.inventoryNextPermissions;
623 InventoryReply.InventoryData[0].OwnerID = Item.avatarID; 624 InventoryReply.InventoryData[0].OwnerID = Item.avatarID;
624 InventoryReply.InventoryData[0].OwnerMask = Item.inventoryCurrentPermissions; 625 InventoryReply.InventoryData[0].OwnerMask = Item.inventoryCurrentPermissions;
625 InventoryReply.InventoryData[0].SalePrice = 100; 626 InventoryReply.InventoryData[0].SalePrice = 100;
626 InventoryReply.InventoryData[0].SaleType = 0; 627 InventoryReply.InventoryData[0].SaleType = 0;
627 InventoryReply.InventoryData[0].Type =(sbyte) Item.assetType; 628 InventoryReply.InventoryData[0].Type = (sbyte)Item.assetType;
628 InventoryReply.InventoryData[0].CRC = Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType, InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID, InventoryReply.InventoryData[0].GroupID, 100, InventoryReply.InventoryData[0].OwnerID, InventoryReply.InventoryData[0].CreatorID, InventoryReply.InventoryData[0].ItemID, InventoryReply.InventoryData[0].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS); 629 InventoryReply.InventoryData[0].CRC = Helpers.InventoryCRC(1000, 0, InventoryReply.InventoryData[0].InvType, InventoryReply.InventoryData[0].Type, InventoryReply.InventoryData[0].AssetID, InventoryReply.InventoryData[0].GroupID, 100, InventoryReply.InventoryData[0].OwnerID, InventoryReply.InventoryData[0].CreatorID, InventoryReply.InventoryData[0].ItemID, InventoryReply.InventoryData[0].FolderID, FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS);
629 630
630 OutPacket(InventoryReply); 631 OutPacket(InventoryReply);
@@ -651,6 +652,15 @@ namespace OpenSim.Region.ClientStack
651 OutPacket(replytask); 652 OutPacket(replytask);
652 } 653 }
653 654
655 public void SendXferPacket(ulong xferID, uint packet, byte[] data)
656 {
657 SendXferPacketPacket sendXfer = new SendXferPacketPacket();
658 sendXfer.XferID.ID = xferID;
659 sendXfer.XferID.Packet = packet;
660 sendXfer.DataPacket.Data = data;
661 OutPacket(sendXfer);
662 }
663
654 /// <summary> 664 /// <summary>
655 /// 665 ///
656 /// </summary> 666 /// </summary>
@@ -689,6 +699,66 @@ namespace OpenSim.Region.ClientStack
689 OutPacket(loadURL); 699 OutPacket(loadURL);
690 } 700 }
691 701
702
703 public void SendPreLoadSound(LLUUID objectID, LLUUID ownerID, LLUUID soundID)
704 {
705 PreloadSoundPacket preSound = new PreloadSoundPacket();
706 preSound.DataBlock = new PreloadSoundPacket.DataBlockBlock[1];
707 preSound.DataBlock[0] = new PreloadSoundPacket.DataBlockBlock();
708 preSound.DataBlock[0].ObjectID = objectID;
709 preSound.DataBlock[0].OwnerID = ownerID;
710 preSound.DataBlock[0].SoundID = soundID;
711 OutPacket(preSound);
712 }
713
714 public void SendPlayAttachedSound(LLUUID soundID, LLUUID objectID, LLUUID ownerID, float gain, byte flags)
715 {
716 AttachedSoundPacket sound = new AttachedSoundPacket();
717 sound.DataBlock.SoundID = soundID;
718 sound.DataBlock.ObjectID = objectID;
719 sound.DataBlock.OwnerID = ownerID;
720 sound.DataBlock.Gain = gain;
721 sound.DataBlock.Flags = flags;
722
723 OutPacket(sound);
724 }
725
726 public void SendViewerTime(int phase)
727 {
728
729 SimulatorViewerTimeMessagePacket viewertime = new SimulatorViewerTimeMessagePacket();
730 //viewertime.TimeInfo.SecPerDay = 86400;
731 // viewertime.TimeInfo.SecPerYear = 31536000;
732 viewertime.TimeInfo.SecPerDay = 1000;
733 viewertime.TimeInfo.SecPerYear = 365000;
734 viewertime.TimeInfo.SunPhase = 1;
735 int sunPhase = (phase + 2) / 2;
736 if ((sunPhase < 12) || (sunPhase > 36))
737 {
738
739 viewertime.TimeInfo.SunDirection = new LLVector3(0f, 0.8f, -0.8f);
740 //Console.WriteLine("sending night");
741 }
742 else
743 {
744 sunPhase = sunPhase - 12;
745 float yValue = 0.1f * (sunPhase);
746 if (yValue > 1.2f) { yValue = yValue - 1.2f; }
747 if (yValue > 1 ) { yValue = 1; }
748 if (yValue < 0) { yValue = 0; }
749 if (sunPhase < 14)
750 {
751 yValue = 1 - yValue;
752 }
753 if (sunPhase < 12) { yValue *= -1; }
754 viewertime.TimeInfo.SunDirection = new LLVector3(0f, yValue, 0.3f);
755 //Console.WriteLine("sending sun update " + yValue);
756 }
757 viewertime.TimeInfo.SunAngVelocity = new LLVector3(0, 0.0f, 10.0f);
758 viewertime.TimeInfo.UsecSinceStart = (ulong)Util.UnixTimeSinceEpoch();
759 OutPacket(viewertime);
760 }
761
692 #endregion 762 #endregion
693 763
694 #region Appearance/ Wearables Methods 764 #region Appearance/ Wearables Methods
@@ -782,7 +852,7 @@ namespace OpenSim.Region.ClientStack
782 //give this avatar object a local id and assign the user a name 852 //give this avatar object a local id and assign the user a name
783 objupdate.ObjectData[0].ID = avatarLocalID; 853 objupdate.ObjectData[0].ID = avatarLocalID;
784 objupdate.ObjectData[0].FullID = avatarID; 854 objupdate.ObjectData[0].FullID = avatarID;
785 objupdate.ObjectData[0].NameValue = Helpers.StringToField("FirstName STRING RW SV " + firstName + "\nLastName STRING RW SV " + lastName ); 855 objupdate.ObjectData[0].NameValue = Helpers.StringToField("FirstName STRING RW SV " + firstName + "\nLastName STRING RW SV " + lastName);
786 LLVector3 pos2 = new LLVector3((float)Pos.X, (float)Pos.Y, (float)Pos.Z); 856 LLVector3 pos2 = new LLVector3((float)Pos.X, (float)Pos.Y, (float)Pos.Z);
787 byte[] pb = pos2.GetBytes(); 857 byte[] pb = pos2.GetBytes();
788 Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length); 858 Array.Copy(pb, 0, objupdate.ObjectData[0].ObjectData, 16, pb.Length);
@@ -834,28 +904,28 @@ namespace OpenSim.Region.ClientStack
834 904
835 this.OutPacket(attach); 905 this.OutPacket(attach);
836 } 906 }
837 907
838 public void SendPrimitiveToClient( 908 public void SendPrimitiveToClient(
839 ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, uint flags, 909 ulong regionHandle, ushort timeDilation, uint localID, PrimitiveBaseShape primShape, LLVector3 pos, uint flags,
840 LLUUID objectID, LLUUID ownerID, string text, uint parentID, byte[] particleSystem, LLQuaternion rotation) 910 LLUUID objectID, LLUUID ownerID, string text, uint parentID, byte[] particleSystem, LLQuaternion rotation)
841 { 911 {
842 ObjectUpdatePacket outPacket = new ObjectUpdatePacket(); 912 ObjectUpdatePacket outPacket = new ObjectUpdatePacket();
843 outPacket.RegionData.RegionHandle = regionHandle; 913 outPacket.RegionData.RegionHandle = regionHandle;
844 outPacket.RegionData.TimeDilation = timeDilation; 914 outPacket.RegionData.TimeDilation = timeDilation;
845 outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1]; 915 outPacket.ObjectData = new ObjectUpdatePacket.ObjectDataBlock[1];
846 916
847 outPacket.ObjectData[0] = this.CreatePrimUpdateBlock(primShape, flags); 917 outPacket.ObjectData[0] = this.CreatePrimUpdateBlock(primShape, flags);
848 918
849 outPacket.ObjectData[0].ID = localID; 919 outPacket.ObjectData[0].ID = localID;
850 outPacket.ObjectData[0].FullID = objectID; 920 outPacket.ObjectData[0].FullID = objectID;
851 outPacket.ObjectData[0].OwnerID = ownerID; 921 outPacket.ObjectData[0].OwnerID = ownerID;
852 outPacket.ObjectData[0].Text = Helpers.StringToField( text ); 922 outPacket.ObjectData[0].Text = Helpers.StringToField(text);
853 outPacket.ObjectData[0].ParentID = parentID; 923 outPacket.ObjectData[0].ParentID = parentID;
854 outPacket.ObjectData[0].PSBlock = particleSystem; 924 outPacket.ObjectData[0].PSBlock = particleSystem;
855 925
856 byte[] pb = pos.GetBytes(); 926 byte[] pb = pos.GetBytes();
857 Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length); 927 Array.Copy(pb, 0, outPacket.ObjectData[0].ObjectData, 0, pb.Length);
858 928
859 byte[] rot = rotation.GetBytes(); 929 byte[] rot = rotation.GetBytes();
860 Array.Copy(rot, 0, outPacket.ObjectData[0].ObjectData, 36, rot.Length); 930 Array.Copy(rot, 0, outPacket.ObjectData[0].ObjectData, 36, rot.Length);
861 931
@@ -1050,7 +1120,7 @@ namespace OpenSim.Region.ClientStack
1050 1120
1051 protected void SetPrimPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData, PrimitiveBaseShape primData) 1121 protected void SetPrimPacketShapeData(ObjectUpdatePacket.ObjectDataBlock objectData, PrimitiveBaseShape primData)
1052 { 1122 {
1053 1123
1054 objectData.TextureEntry = primData.TextureEntry; 1124 objectData.TextureEntry = primData.TextureEntry;
1055 objectData.PCode = primData.PCode; 1125 objectData.PCode = primData.PCode;
1056 objectData.PathBegin = primData.PathBegin; 1126 objectData.PathBegin = primData.PathBegin;
@@ -1171,14 +1241,14 @@ namespace OpenSim.Region.ClientStack
1171 public void SendNameReply(LLUUID profileId, string firstname, string lastname) 1241 public void SendNameReply(LLUUID profileId, string firstname, string lastname)
1172 { 1242 {
1173 UUIDNameReplyPacket packet = new UUIDNameReplyPacket(); 1243 UUIDNameReplyPacket packet = new UUIDNameReplyPacket();
1174 1244
1175 packet.UUIDNameBlock = new UUIDNameReplyPacket.UUIDNameBlockBlock[1]; 1245 packet.UUIDNameBlock = new UUIDNameReplyPacket.UUIDNameBlockBlock[1];
1176 packet.UUIDNameBlock[0] = new UUIDNameReplyPacket.UUIDNameBlockBlock(); 1246 packet.UUIDNameBlock[0] = new UUIDNameReplyPacket.UUIDNameBlockBlock();
1177 packet.UUIDNameBlock[0].ID = profileId; 1247 packet.UUIDNameBlock[0].ID = profileId;
1178 packet.UUIDNameBlock[0].FirstName = Helpers.StringToField( firstname ); 1248 packet.UUIDNameBlock[0].FirstName = Helpers.StringToField(firstname);
1179 packet.UUIDNameBlock[0].LastName = Helpers.StringToField( lastname ); 1249 packet.UUIDNameBlock[0].LastName = Helpers.StringToField(lastname);
1180 1250
1181 OutPacket( packet ); 1251 OutPacket(packet);
1182 } 1252 }
1183 1253
1184 #endregion 1254 #endregion