diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ClientStack/Assets/InventoryCache.cs | 1 | ||||
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.API.cs | 122 |
2 files changed, 100 insertions, 23 deletions
diff --git a/OpenSim/Region/ClientStack/Assets/InventoryCache.cs b/OpenSim/Region/ClientStack/Assets/InventoryCache.cs index 082c0d0..e2cfa46 100644 --- a/OpenSim/Region/ClientStack/Assets/InventoryCache.cs +++ b/OpenSim/Region/ClientStack/Assets/InventoryCache.cs | |||
@@ -196,6 +196,7 @@ namespace OpenSim.Assets | |||
196 | 196 | ||
197 | public void FetchInventoryDescendents(ClientView userInfo, FetchInventoryDescendentsPacket FetchDescend) | 197 | public void FetchInventoryDescendents(ClientView userInfo, FetchInventoryDescendentsPacket FetchDescend) |
198 | { | 198 | { |
199 | |||
199 | if (this._agentsInventory.ContainsKey(userInfo.AgentID)) | 200 | if (this._agentsInventory.ContainsKey(userInfo.AgentID)) |
200 | { | 201 | { |
201 | AgentInventory agentInventory = this._agentsInventory[userInfo.AgentID]; | 202 | AgentInventory agentInventory = this._agentsInventory[userInfo.AgentID]; |
diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index 225e906..d5b6b52 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs | |||
@@ -35,6 +35,7 @@ using libsecondlife.Packets; | |||
35 | using OpenSim.Framework.Console; | 35 | using OpenSim.Framework.Console; |
36 | using OpenSim.Framework.Interfaces; | 36 | using OpenSim.Framework.Interfaces; |
37 | using OpenSim.Framework.Types; | 37 | using OpenSim.Framework.Types; |
38 | using OpenSim.Framework.Data; | ||
38 | 39 | ||
39 | namespace OpenSim.Region.ClientStack | 40 | namespace OpenSim.Region.ClientStack |
40 | { | 41 | { |
@@ -76,7 +77,7 @@ namespace OpenSim.Region.ClientStack | |||
76 | public event GenericCall6 OnRemoveAvatar; | 77 | public event GenericCall6 OnRemoveAvatar; |
77 | public event RequestMapBlocks OnRequestMapBlocks; | 78 | public event RequestMapBlocks OnRequestMapBlocks; |
78 | public event TeleportLocationRequest OnTeleportLocationRequest; | 79 | public event TeleportLocationRequest OnTeleportLocationRequest; |
79 | 80 | ||
80 | public event UUIDNameRequest OnNameFromUUIDRequest; | 81 | public event UUIDNameRequest OnNameFromUUIDRequest; |
81 | 82 | ||
82 | public event ParcelPropertiesRequest OnParcelPropertiesRequest; | 83 | public event ParcelPropertiesRequest OnParcelPropertiesRequest; |
@@ -188,7 +189,7 @@ namespace OpenSim.Region.ClientStack | |||
188 | mov.Data.RegionHandle = regInfo.RegionHandle; | 189 | mov.Data.RegionHandle = regInfo.RegionHandle; |
189 | mov.Data.Timestamp = 1172750370; // TODO - dynamicalise this | 190 | mov.Data.Timestamp = 1172750370; // TODO - dynamicalise this |
190 | 191 | ||
191 | if ((pos.X == 0) && (pos.Y == 0) && (pos.Z == 0)) | 192 | if ((pos.X == 0) && (pos.Y == 0) && (pos.Z == 0)) |
192 | { | 193 | { |
193 | mov.Data.Position = this.startpos; | 194 | mov.Data.Position = this.startpos; |
194 | } | 195 | } |
@@ -325,11 +326,11 @@ namespace OpenSim.Region.ClientStack | |||
325 | /// <param name="neighbourHandle"></param> | 326 | /// <param name="neighbourHandle"></param> |
326 | /// <param name="neighbourIP"></param> | 327 | /// <param name="neighbourIP"></param> |
327 | /// <param name="neighbourPort"></param> | 328 | /// <param name="neighbourPort"></param> |
328 | public void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourEndPoint ) | 329 | public void InformClientOfNeighbour(ulong neighbourHandle, IPEndPoint neighbourEndPoint) |
329 | { | 330 | { |
330 | IPAddress neighbourIP = neighbourEndPoint.Address; | 331 | IPAddress neighbourIP = neighbourEndPoint.Address; |
331 | ushort neighbourPort = (ushort) neighbourEndPoint.Port; | 332 | ushort neighbourPort = (ushort)neighbourEndPoint.Port; |
332 | 333 | ||
333 | EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket(); | 334 | EnableSimulatorPacket enablesimpacket = new EnableSimulatorPacket(); |
334 | enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock(); | 335 | enablesimpacket.SimulatorInfo = new EnableSimulatorPacket.SimulatorInfoBlock(); |
335 | enablesimpacket.SimulatorInfo.Handle = neighbourHandle; | 336 | enablesimpacket.SimulatorInfo.Handle = neighbourHandle; |
@@ -405,7 +406,7 @@ namespace OpenSim.Region.ClientStack | |||
405 | mapReply.Data[i].Name = _enc.GetBytes(mapBlocks[i].Name); | 406 | mapReply.Data[i].Name = _enc.GetBytes(mapBlocks[i].Name); |
406 | mapReply.Data[i].RegionFlags = mapBlocks[i].RegionFlags; | 407 | mapReply.Data[i].RegionFlags = mapBlocks[i].RegionFlags; |
407 | mapReply.Data[i].Access = mapBlocks[i].Access; | 408 | mapReply.Data[i].Access = mapBlocks[i].Access; |
408 | mapReply.Data[i].Agents = mapBlocks[i].Agents; | 409 | mapReply.Data[i].Agents = mapBlocks[i].Agents; |
409 | } | 410 | } |
410 | this.OutPacket(mapReply); | 411 | this.OutPacket(mapReply); |
411 | } | 412 | } |
@@ -421,7 +422,7 @@ namespace OpenSim.Region.ClientStack | |||
421 | OutPacket(tpLocal); | 422 | OutPacket(tpLocal); |
422 | } | 423 | } |
423 | 424 | ||
424 | public void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint newRegionEndPoint, uint locationID, uint flags) | 425 | public void SendRegionTeleport(ulong regionHandle, byte simAccess, IPEndPoint newRegionEndPoint, uint locationID, uint flags) |
425 | { | 426 | { |
426 | TeleportFinishPacket teleport = new TeleportFinishPacket(); | 427 | TeleportFinishPacket teleport = new TeleportFinishPacket(); |
427 | teleport.Info.AgentID = this.AgentID; | 428 | teleport.Info.AgentID = this.AgentID; |
@@ -439,7 +440,7 @@ namespace OpenSim.Region.ClientStack | |||
439 | teleport.Info.SimIP = ip; | 440 | teleport.Info.SimIP = ip; |
440 | teleport.Info.SimPort = (ushort)newRegionEndPoint.Port; | 441 | teleport.Info.SimPort = (ushort)newRegionEndPoint.Port; |
441 | teleport.Info.LocationID = 4; | 442 | teleport.Info.LocationID = 4; |
442 | teleport.Info.TeleportFlags = 1 << 4; | 443 | teleport.Info.TeleportFlags = 1 << 4; |
443 | OutPacket(teleport); | 444 | OutPacket(teleport); |
444 | } | 445 | } |
445 | 446 | ||
@@ -492,6 +493,81 @@ namespace OpenSim.Region.ClientStack | |||
492 | OutPacket(kill); | 493 | OutPacket(kill); |
493 | } | 494 | } |
494 | 495 | ||
496 | public void SendInventoryFolderDetails(LLUUID ownerID, LLUUID folderID, List<InventoryItemBase> items) | ||
497 | { | ||
498 | Encoding enc = Encoding.ASCII; | ||
499 | uint FULL_MASK_PERMISSIONS = 2147483647; | ||
500 | InventoryDescendentsPacket descend = new InventoryDescendentsPacket(); | ||
501 | descend.AgentData.AgentID = this.AgentId; | ||
502 | descend.AgentData.OwnerID = ownerID; | ||
503 | descend.AgentData.FolderID = folderID; | ||
504 | descend.AgentData.Descendents = items.Count; | ||
505 | descend.AgentData.Version = 0; | ||
506 | descend.ItemData = new InventoryDescendentsPacket.ItemDataBlock[items.Count]; | ||
507 | int i = 0; | ||
508 | foreach (InventoryItemBase item in items) | ||
509 | { | ||
510 | descend.ItemData[i] = new InventoryDescendentsPacket.ItemDataBlock(); | ||
511 | descend.ItemData[i].ItemID = item.inventoryID; | ||
512 | descend.ItemData[i].AssetID = item.assetID; | ||
513 | descend.ItemData[i].CreatorID = item.creatorsID; | ||
514 | descend.ItemData[i].BaseMask = FULL_MASK_PERMISSIONS; | ||
515 | descend.ItemData[i].CreationDate = 1000; | ||
516 | descend.ItemData[i].Description = enc.GetBytes(item.inventoryDescription+ "\0"); | ||
517 | descend.ItemData[i].EveryoneMask = FULL_MASK_PERMISSIONS; | ||
518 | descend.ItemData[i].Flags = 1; | ||
519 | descend.ItemData[i].FolderID = item.parentFolderID; | ||
520 | descend.ItemData[i].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); | ||
521 | descend.ItemData[i].GroupMask = FULL_MASK_PERMISSIONS; | ||
522 | descend.ItemData[i].InvType = (sbyte)item.type; | ||
523 | descend.ItemData[i].Name = enc.GetBytes(item.inventoryName+ "\0"); | ||
524 | descend.ItemData[i].NextOwnerMask = FULL_MASK_PERMISSIONS; | ||
525 | descend.ItemData[i].OwnerID = item.avatarID; | ||
526 | descend.ItemData[i].OwnerMask = FULL_MASK_PERMISSIONS; | ||
527 | descend.ItemData[i].SalePrice = 0; | ||
528 | descend.ItemData[i].SaleType = 0; | ||
529 | descend.ItemData[i].Type = (sbyte)item.type; | ||
530 | 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); | ||
531 | |||
532 | i++; | ||
533 | } | ||
534 | |||
535 | this.OutPacket(descend); | ||
536 | |||
537 | } | ||
538 | |||
539 | public void SendInventoryItemDetails(LLUUID ownerID, LLUUID folderID, InventoryItemBase item) | ||
540 | { | ||
541 | Encoding enc = Encoding.ASCII; | ||
542 | uint FULL_MASK_PERMISSIONS = 2147483647; | ||
543 | FetchInventoryReplyPacket inventoryReply = new FetchInventoryReplyPacket(); | ||
544 | inventoryReply.AgentData.AgentID = this.AgentId; | ||
545 | inventoryReply.InventoryData = new FetchInventoryReplyPacket.InventoryDataBlock[1]; | ||
546 | inventoryReply.InventoryData[0] = new FetchInventoryReplyPacket.InventoryDataBlock(); | ||
547 | inventoryReply.InventoryData[0].ItemID = item.inventoryID; | ||
548 | inventoryReply.InventoryData[0].AssetID = item.assetID; | ||
549 | inventoryReply.InventoryData[0].CreatorID = item.creatorsID; | ||
550 | inventoryReply.InventoryData[0].BaseMask = FULL_MASK_PERMISSIONS; | ||
551 | inventoryReply.InventoryData[0].CreationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; | ||
552 | inventoryReply.InventoryData[0].Description = enc.GetBytes(item.inventoryDescription + "\0"); | ||
553 | inventoryReply.InventoryData[0].EveryoneMask = FULL_MASK_PERMISSIONS; | ||
554 | inventoryReply.InventoryData[0].Flags = 0; | ||
555 | inventoryReply.InventoryData[0].FolderID = item.parentFolderID; | ||
556 | inventoryReply.InventoryData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); | ||
557 | inventoryReply.InventoryData[0].GroupMask = FULL_MASK_PERMISSIONS; | ||
558 | inventoryReply.InventoryData[0].InvType = (sbyte)item.type; | ||
559 | inventoryReply.InventoryData[0].Name = enc.GetBytes(item.inventoryName + "\0"); | ||
560 | inventoryReply.InventoryData[0].NextOwnerMask = FULL_MASK_PERMISSIONS; | ||
561 | inventoryReply.InventoryData[0].OwnerID = item.avatarID; | ||
562 | inventoryReply.InventoryData[0].OwnerMask = FULL_MASK_PERMISSIONS; | ||
563 | inventoryReply.InventoryData[0].SalePrice = 0; | ||
564 | inventoryReply.InventoryData[0].SaleType = 0; | ||
565 | inventoryReply.InventoryData[0].Type = (sbyte)item.type; | ||
566 | 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); | ||
567 | |||
568 | this.OutPacket(inventoryReply); | ||
569 | } | ||
570 | |||
495 | 571 | ||
496 | #region Appearance/ Wearables Methods | 572 | #region Appearance/ Wearables Methods |
497 | 573 | ||
@@ -545,20 +621,20 @@ namespace OpenSim.Region.ClientStack | |||
545 | OutPacket(avp); | 621 | OutPacket(avp); |
546 | } | 622 | } |
547 | 623 | ||
548 | public void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId) | 624 | public void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId) |
549 | { | 625 | { |
550 | AvatarAnimationPacket ani = new AvatarAnimationPacket(); | 626 | AvatarAnimationPacket ani = new AvatarAnimationPacket(); |
551 | ani.AnimationSourceList = new AvatarAnimationPacket.AnimationSourceListBlock[1]; | 627 | ani.AnimationSourceList = new AvatarAnimationPacket.AnimationSourceListBlock[1]; |
552 | ani.AnimationSourceList[0] = new AvatarAnimationPacket.AnimationSourceListBlock(); | 628 | ani.AnimationSourceList[0] = new AvatarAnimationPacket.AnimationSourceListBlock(); |
553 | ani.AnimationSourceList[0].ObjectID = sourceAgentId; | 629 | ani.AnimationSourceList[0].ObjectID = sourceAgentId; |
554 | ani.Sender = new AvatarAnimationPacket.SenderBlock(); | 630 | ani.Sender = new AvatarAnimationPacket.SenderBlock(); |
555 | ani.Sender.ID = sourceAgentId; | 631 | ani.Sender.ID = sourceAgentId; |
556 | ani.AnimationList = new AvatarAnimationPacket.AnimationListBlock[1]; | 632 | ani.AnimationList = new AvatarAnimationPacket.AnimationListBlock[1]; |
557 | ani.AnimationList[0] = new AvatarAnimationPacket.AnimationListBlock(); | 633 | ani.AnimationList[0] = new AvatarAnimationPacket.AnimationListBlock(); |
558 | ani.AnimationList[0].AnimID = animID; | 634 | ani.AnimationList[0].AnimID = animID; |
559 | ani.AnimationList[0].AnimSequenceID = seq; | 635 | ani.AnimationList[0].AnimSequenceID = seq; |
560 | this.OutPacket(ani); | 636 | this.OutPacket(ani); |
561 | } | 637 | } |
562 | 638 | ||
563 | #endregion | 639 | #endregion |
564 | 640 | ||
@@ -674,7 +750,7 @@ namespace OpenSim.Region.ClientStack | |||
674 | /// </summary> | 750 | /// </summary> |
675 | /// <param name="primData"></param> | 751 | /// <param name="primData"></param> |
676 | /// <param name="pos"></param> | 752 | /// <param name="pos"></param> |
677 | public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID , uint flags) | 753 | public void SendPrimitiveToClient(ulong regionHandle, ushort timeDilation, uint localID, PrimData primData, LLVector3 pos, LLUUID textureID, uint flags) |
678 | { | 754 | { |
679 | ObjectUpdatePacket outPacket = new ObjectUpdatePacket(); | 755 | ObjectUpdatePacket outPacket = new ObjectUpdatePacket(); |
680 | outPacket.RegionData.RegionHandle = regionHandle; | 756 | outPacket.RegionData.RegionHandle = regionHandle; |