diff options
author | Justin Clarke Casey | 2008-04-07 01:46:00 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-04-07 01:46:00 +0000 |
commit | dfe5e9d4ebb705d0c20d6260bae5d11659ac904d (patch) | |
tree | 013b251f500feebfdeae94681350d05c078533ee /OpenSim/Region/ClientStack/ClientView.cs | |
parent | Update svn properties. (diff) | |
download | opensim-SC-dfe5e9d4ebb705d0c20d6260bae5d11659ac904d.zip opensim-SC-dfe5e9d4ebb705d0c20d6260bae5d11659ac904d.tar.gz opensim-SC-dfe5e9d4ebb705d0c20d6260bae5d11659ac904d.tar.bz2 opensim-SC-dfe5e9d4ebb705d0c20d6260bae5d11659ac904d.tar.xz |
* EXPERIMENTAL ROUGH DRAFT: First rough implementation of avatar to avatar item giving
* Now you can drag an object from your inventory and give it to another avatar
* !!! Use at your own risk !!! Many things are unimplemented as of yet, including permissions (the person receiving your item can probably do absolutely everything with it)
* Also, items for the receiving end up in their root folder rather than the objects folder
Diffstat (limited to 'OpenSim/Region/ClientStack/ClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/ClientView.cs | 84 |
1 files changed, 80 insertions, 4 deletions
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index a67c247..c98eb84 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs | |||
@@ -482,6 +482,11 @@ namespace OpenSim.Region.ClientStack | |||
482 | return result; | 482 | return result; |
483 | } | 483 | } |
484 | 484 | ||
485 | /// <summary> | ||
486 | /// Try to process a packet using registered packet handlers | ||
487 | /// </summary> | ||
488 | /// <param name="packet"></param> | ||
489 | /// <returns>True if a handler was found which successfully processed the packet.</returns> | ||
485 | protected virtual bool ProcessPacketMethod(Packet packet) | 490 | protected virtual bool ProcessPacketMethod(Packet packet) |
486 | { | 491 | { |
487 | bool result = false; | 492 | bool result = false; |
@@ -865,14 +870,30 @@ namespace OpenSim.Region.ClientStack | |||
865 | } | 870 | } |
866 | 871 | ||
867 | /// <summary> | 872 | /// <summary> |
868 | /// | 873 | /// Send an instant message to this client |
869 | /// </summary> | 874 | /// </summary> |
870 | /// <param name="message"></param> | 875 | /// <param name="message"></param> |
871 | /// <param name="target"></param> | 876 | /// <param name="target"></param> |
872 | public void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent, | 877 | public void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent, |
873 | LLUUID imSessionID, string fromName, byte dialog, uint timeStamp) | 878 | LLUUID imSessionID, string fromName, byte dialog, uint timeStamp) |
874 | { | 879 | { |
875 | ImprovedInstantMessagePacket msg = (ImprovedInstantMessagePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedInstantMessage); | 880 | SendInstantMessage( |
881 | fromAgent, fromAgentSession, message, toAgent, | ||
882 | imSessionID, fromName, dialog, timeStamp, new byte[0]); | ||
883 | } | ||
884 | |||
885 | /// <summary> | ||
886 | /// Send an instant message to this client | ||
887 | /// </summary> | ||
888 | /// <param name="message"></param> | ||
889 | /// <param name="target"></param> | ||
890 | public void SendInstantMessage(LLUUID fromAgent, LLUUID fromAgentSession, string message, LLUUID toAgent, | ||
891 | LLUUID imSessionID, string fromName, byte dialog, uint timeStamp, | ||
892 | byte[] binaryBucket) | ||
893 | { | ||
894 | ImprovedInstantMessagePacket msg | ||
895 | = (ImprovedInstantMessagePacket)PacketPool.Instance.GetPacket(PacketType.ImprovedInstantMessage); | ||
896 | |||
876 | msg.AgentData.AgentID = fromAgent; | 897 | msg.AgentData.AgentID = fromAgent; |
877 | msg.AgentData.SessionID = fromAgentSession; | 898 | msg.AgentData.SessionID = fromAgentSession; |
878 | msg.MessageBlock.FromAgentName = Helpers.StringToField(fromName); | 899 | msg.MessageBlock.FromAgentName = Helpers.StringToField(fromName); |
@@ -886,7 +907,7 @@ namespace OpenSim.Region.ClientStack | |||
886 | msg.MessageBlock.Timestamp = timeStamp; | 907 | msg.MessageBlock.Timestamp = timeStamp; |
887 | msg.MessageBlock.ToAgentID = toAgent; | 908 | msg.MessageBlock.ToAgentID = toAgent; |
888 | msg.MessageBlock.Message = Helpers.StringToField(message); | 909 | msg.MessageBlock.Message = Helpers.StringToField(message); |
889 | msg.MessageBlock.BinaryBucket = new byte[0]; | 910 | msg.MessageBlock.BinaryBucket = binaryBucket; |
890 | 911 | ||
891 | OutPacket(msg, ThrottleOutPacketType.Task); | 912 | OutPacket(msg, ThrottleOutPacketType.Task); |
892 | } | 913 | } |
@@ -1374,12 +1395,67 @@ namespace OpenSim.Region.ClientStack | |||
1374 | 1395 | ||
1375 | OutPacket(inventoryReply, ThrottleOutPacketType.Asset); | 1396 | OutPacket(inventoryReply, ThrottleOutPacketType.Asset); |
1376 | } | 1397 | } |
1398 | |||
1399 | /// <see>IClientAPI.SendBulkUpdateInventory(InventoryItemBase)</see> | ||
1400 | public void SendBulkUpdateInventory(InventoryItemBase item) | ||
1401 | { | ||
1402 | uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All; | ||
1403 | |||
1404 | BulkUpdateInventoryPacket bulkUpdate | ||
1405 | = (BulkUpdateInventoryPacket)PacketPool.Instance.GetPacket(PacketType.BulkUpdateInventory); | ||
1406 | |||
1407 | bulkUpdate.AgentData.AgentID = AgentId; | ||
1408 | bulkUpdate.AgentData.TransactionID = LLUUID.Random(); | ||
1409 | |||
1410 | bulkUpdate.FolderData = new BulkUpdateInventoryPacket.FolderDataBlock[1]; | ||
1411 | bulkUpdate.FolderData[0] = new BulkUpdateInventoryPacket.FolderDataBlock(); | ||
1412 | bulkUpdate.FolderData[0].FolderID = LLUUID.Zero; | ||
1413 | bulkUpdate.FolderData[0].ParentID = LLUUID.Zero; | ||
1414 | bulkUpdate.FolderData[0].Type = -1; | ||
1415 | bulkUpdate.FolderData[0].Name = new byte[0]; | ||
1416 | |||
1417 | bulkUpdate.ItemData = new BulkUpdateInventoryPacket.ItemDataBlock[1]; | ||
1418 | bulkUpdate.ItemData[0] = new BulkUpdateInventoryPacket.ItemDataBlock(); | ||
1419 | bulkUpdate.ItemData[0].ItemID = item.inventoryID; | ||
1420 | bulkUpdate.ItemData[0].AssetID = item.assetID; | ||
1421 | bulkUpdate.ItemData[0].CreatorID = item.creatorsID; | ||
1422 | bulkUpdate.ItemData[0].BaseMask = item.inventoryBasePermissions; | ||
1423 | bulkUpdate.ItemData[0].CreationDate = 1000; | ||
1424 | bulkUpdate.ItemData[0].Description = Helpers.StringToField(item.inventoryDescription); | ||
1425 | bulkUpdate.ItemData[0].EveryoneMask = item.inventoryEveryOnePermissions; | ||
1426 | bulkUpdate.ItemData[0].Flags = 0; | ||
1427 | bulkUpdate.ItemData[0].FolderID = item.parentFolderID; | ||
1428 | bulkUpdate.ItemData[0].GroupID = new LLUUID("00000000-0000-0000-0000-000000000000"); | ||
1429 | bulkUpdate.ItemData[0].GroupMask = 0; | ||
1430 | bulkUpdate.ItemData[0].InvType = (sbyte)item.invType; | ||
1431 | bulkUpdate.ItemData[0].Name = Helpers.StringToField(item.inventoryName); | ||
1432 | bulkUpdate.ItemData[0].NextOwnerMask = item.inventoryNextPermissions; | ||
1433 | bulkUpdate.ItemData[0].OwnerID = item.avatarID; | ||
1434 | bulkUpdate.ItemData[0].OwnerMask = item.inventoryCurrentPermissions; | ||
1435 | bulkUpdate.ItemData[0].SalePrice = 100; | ||
1436 | bulkUpdate.ItemData[0].SaleType = 0; | ||
1437 | bulkUpdate.ItemData[0].Type = (sbyte)item.assetType; | ||
1438 | bulkUpdate.ItemData[0].CRC = | ||
1439 | Helpers.InventoryCRC(1000, 0, bulkUpdate.ItemData[0].InvType, | ||
1440 | bulkUpdate.ItemData[0].Type, bulkUpdate.ItemData[0].AssetID, | ||
1441 | bulkUpdate.ItemData[0].GroupID, 100, | ||
1442 | bulkUpdate.ItemData[0].OwnerID, bulkUpdate.ItemData[0].CreatorID, | ||
1443 | bulkUpdate.ItemData[0].ItemID, bulkUpdate.ItemData[0].FolderID, | ||
1444 | FULL_MASK_PERMISSIONS, 1, FULL_MASK_PERMISSIONS, FULL_MASK_PERMISSIONS, | ||
1445 | FULL_MASK_PERMISSIONS); | ||
1446 | |||
1447 | OutPacket(bulkUpdate, ThrottleOutPacketType.Asset); | ||
1448 | } | ||
1377 | 1449 | ||
1378 | /// <see>IClientAPI.SendInventoryItemCreateUpdate(InventoryItemBase)</see> | 1450 | /// <see>IClientAPI.SendInventoryItemCreateUpdate(InventoryItemBase)</see> |
1379 | public void SendInventoryItemCreateUpdate(InventoryItemBase Item) | 1451 | public void SendInventoryItemCreateUpdate(InventoryItemBase Item) |
1380 | { | 1452 | { |
1381 | uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All; | 1453 | uint FULL_MASK_PERMISSIONS = (uint)PermissionMask.All; |
1382 | UpdateCreateInventoryItemPacket InventoryReply = (UpdateCreateInventoryItemPacket)PacketPool.Instance.GetPacket(PacketType.UpdateCreateInventoryItem); | 1454 | |
1455 | UpdateCreateInventoryItemPacket InventoryReply | ||
1456 | = (UpdateCreateInventoryItemPacket)PacketPool.Instance.GetPacket( | ||
1457 | PacketType.UpdateCreateInventoryItem); | ||
1458 | |||
1383 | // TODO: don't create new blocks if recycling an old packet | 1459 | // TODO: don't create new blocks if recycling an old packet |
1384 | InventoryReply.AgentData.AgentID = AgentId; | 1460 | InventoryReply.AgentData.AgentID = AgentId; |
1385 | InventoryReply.AgentData.SimApproved = true; | 1461 | InventoryReply.AgentData.SimApproved = true; |