aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
authorJustin Clarke Casey2009-03-05 19:32:27 +0000
committerJustin Clarke Casey2009-03-05 19:32:27 +0000
commit6c735e0828063dd6e83dc6bd4c35266dd948035e (patch)
tree9593d8bf7bd700d364924d1d13d51bd564cebb8d /OpenSim/Region/ClientStack
parent* remove now unused serialization code (diff)
downloadopensim-SC-6c735e0828063dd6e83dc6bd4c35266dd948035e.zip
opensim-SC-6c735e0828063dd6e83dc6bd4c35266dd948035e.tar.gz
opensim-SC-6c735e0828063dd6e83dc6bd4c35266dd948035e.tar.bz2
opensim-SC-6c735e0828063dd6e83dc6bd4c35266dd948035e.tar.xz
* Replace some string to byte conversions for object/item name/description fields with the LLUtil function that prevents the max string size from being breached
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs49
1 files changed, 28 insertions, 21 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 935f804..6e1bd82 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -1182,12 +1182,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1182 /// </summary> 1182 /// </summary>
1183 // 1183 //
1184 // Don't remove transaction ID! Groups and item gives need to set it! 1184 // Don't remove transaction ID! Groups and item gives need to set it!
1185 //
1186 public void SendInstantMessage(UUID fromAgent, string message, UUID toAgent, 1185 public void SendInstantMessage(UUID fromAgent, string message, UUID toAgent,
1187 string fromName, byte dialog, uint timeStamp, 1186 string fromName, byte dialog, uint timeStamp,
1188 UUID transactionID, bool fromGroup, byte[] binaryBucket) 1187 UUID transactionID, bool fromGroup, byte[] binaryBucket)
1189 { 1188 {
1190
1191 if (((Scene)(m_scene)).Permissions.CanInstantMessage(fromAgent, toAgent)) 1189 if (((Scene)(m_scene)).Permissions.CanInstantMessage(fromAgent, toAgent))
1192 { 1190 {
1193 ImprovedInstantMessagePacket msg 1191 ImprovedInstantMessagePacket msg
@@ -1242,7 +1240,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1242 1240
1243 public void SendGenericMessage(string method, List<string> message) 1241 public void SendGenericMessage(string method, List<string> message)
1244 { 1242 {
1245
1246 GenericMessagePacket gmp = new GenericMessagePacket(); 1243 GenericMessagePacket gmp = new GenericMessagePacket();
1247 gmp.MethodData.Method = Utils.StringToBytes(method); 1244 gmp.MethodData.Method = Utils.StringToBytes(method);
1248 gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count]; 1245 gmp.ParamList = new GenericMessagePacket.ParamListBlock[message.Count];
@@ -1681,12 +1678,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1681 descend.ItemData[i].AssetID = item.AssetID; 1678 descend.ItemData[i].AssetID = item.AssetID;
1682 descend.ItemData[i].CreatorID = item.Creator; 1679 descend.ItemData[i].CreatorID = item.Creator;
1683 descend.ItemData[i].BaseMask = item.BasePermissions; 1680 descend.ItemData[i].BaseMask = item.BasePermissions;
1684 descend.ItemData[i].Description = Utils.StringToBytes(item.Description); 1681 descend.ItemData[i].Description = LLUtil.StringToPacketBytes(item.Description);
1685 descend.ItemData[i].EveryoneMask = item.EveryOnePermissions; 1682 descend.ItemData[i].EveryoneMask = item.EveryOnePermissions;
1686 descend.ItemData[i].OwnerMask = item.CurrentPermissions; 1683 descend.ItemData[i].OwnerMask = item.CurrentPermissions;
1687 descend.ItemData[i].FolderID = item.Folder; 1684 descend.ItemData[i].FolderID = item.Folder;
1688 descend.ItemData[i].InvType = (sbyte)item.InvType; 1685 descend.ItemData[i].InvType = (sbyte)item.InvType;
1689 descend.ItemData[i].Name = Utils.StringToBytes(item.Name); 1686 descend.ItemData[i].Name = LLUtil.StringToPacketBytes(item.Name);
1690 descend.ItemData[i].NextOwnerMask = item.NextPermissions; 1687 descend.ItemData[i].NextOwnerMask = item.NextPermissions;
1691 descend.ItemData[i].OwnerID = item.Owner; 1688 descend.ItemData[i].OwnerID = item.Owner;
1692 descend.ItemData[i].Type = (sbyte)item.AssetType; 1689 descend.ItemData[i].Type = (sbyte)item.AssetType;
@@ -1764,7 +1761,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1764 { 1761 {
1765 descend.FolderData[i] = new InventoryDescendentsPacket.FolderDataBlock(); 1762 descend.FolderData[i] = new InventoryDescendentsPacket.FolderDataBlock();
1766 descend.FolderData[i].FolderID = folder.ID; 1763 descend.FolderData[i].FolderID = folder.ID;
1767 descend.FolderData[i].Name = Utils.StringToBytes(folder.Name); 1764 descend.FolderData[i].Name = LLUtil.StringToPacketBytes(folder.Name);
1768 descend.FolderData[i].ParentID = folder.ParentID; 1765 descend.FolderData[i].ParentID = folder.ParentID;
1769 descend.FolderData[i].Type = (sbyte)folder.Type; 1766 descend.FolderData[i].Type = (sbyte)folder.Type;
1770 1767
@@ -1827,11 +1824,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1827 inventoryReply.InventoryData[0].BaseMask = item.BasePermissions; 1824 inventoryReply.InventoryData[0].BaseMask = item.BasePermissions;
1828 inventoryReply.InventoryData[0].CreationDate = item.CreationDate; 1825 inventoryReply.InventoryData[0].CreationDate = item.CreationDate;
1829 1826
1830 inventoryReply.InventoryData[0].Description = Utils.StringToBytes(item.Description); 1827 inventoryReply.InventoryData[0].Description = LLUtil.StringToPacketBytes(item.Description);
1831 inventoryReply.InventoryData[0].EveryoneMask = item.EveryOnePermissions; 1828 inventoryReply.InventoryData[0].EveryoneMask = item.EveryOnePermissions;
1832 inventoryReply.InventoryData[0].FolderID = item.Folder; 1829 inventoryReply.InventoryData[0].FolderID = item.Folder;
1833 inventoryReply.InventoryData[0].InvType = (sbyte)item.InvType; 1830 inventoryReply.InventoryData[0].InvType = (sbyte)item.InvType;
1834 inventoryReply.InventoryData[0].Name = Utils.StringToBytes(item.Name); 1831 inventoryReply.InventoryData[0].Name = LLUtil.StringToPacketBytes(item.Name);
1835 inventoryReply.InventoryData[0].NextOwnerMask = item.NextPermissions; 1832 inventoryReply.InventoryData[0].NextOwnerMask = item.NextPermissions;
1836 inventoryReply.InventoryData[0].OwnerID = item.Owner; 1833 inventoryReply.InventoryData[0].OwnerID = item.Owner;
1837 inventoryReply.InventoryData[0].OwnerMask = item.CurrentPermissions; 1834 inventoryReply.InventoryData[0].OwnerMask = item.CurrentPermissions;
@@ -1954,7 +1951,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1954 folderBlock.FolderID = folder.ID; 1951 folderBlock.FolderID = folder.ID;
1955 folderBlock.ParentID = folder.ParentID; 1952 folderBlock.ParentID = folder.ParentID;
1956 folderBlock.Type = -1; 1953 folderBlock.Type = -1;
1957 folderBlock.Name = Utils.StringToBytes(folder.Name); 1954 folderBlock.Name = LLUtil.StringToPacketBytes(folder.Name);
1958 1955
1959 return folderBlock; 1956 return folderBlock;
1960 } 1957 }
@@ -1972,11 +1969,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
1972 itemBlock.AssetID = item.AssetID; 1969 itemBlock.AssetID = item.AssetID;
1973 itemBlock.CreatorID = item.Creator; 1970 itemBlock.CreatorID = item.Creator;
1974 itemBlock.BaseMask = item.BasePermissions; 1971 itemBlock.BaseMask = item.BasePermissions;
1975 itemBlock.Description = Utils.StringToBytes(item.Description); 1972 itemBlock.Description = LLUtil.StringToPacketBytes(item.Description);
1976 itemBlock.EveryoneMask = item.EveryOnePermissions; 1973 itemBlock.EveryoneMask = item.EveryOnePermissions;
1977 itemBlock.FolderID = item.Folder; 1974 itemBlock.FolderID = item.Folder;
1978 itemBlock.InvType = (sbyte)item.InvType; 1975 itemBlock.InvType = (sbyte)item.InvType;
1979 itemBlock.Name = Utils.StringToBytes(item.Name); 1976 itemBlock.Name = LLUtil.StringToPacketBytes(item.Name);
1980 itemBlock.NextOwnerMask = item.NextPermissions; 1977 itemBlock.NextOwnerMask = item.NextPermissions;
1981 itemBlock.OwnerID = item.Owner; 1978 itemBlock.OwnerID = item.Owner;
1982 itemBlock.OwnerMask = item.CurrentPermissions; 1979 itemBlock.OwnerMask = item.CurrentPermissions;
@@ -2036,11 +2033,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2036 bulkUpdate.ItemData[0].CreatorID = item.Creator; 2033 bulkUpdate.ItemData[0].CreatorID = item.Creator;
2037 bulkUpdate.ItemData[0].BaseMask = item.BasePermissions; 2034 bulkUpdate.ItemData[0].BaseMask = item.BasePermissions;
2038 bulkUpdate.ItemData[0].CreationDate = 1000; 2035 bulkUpdate.ItemData[0].CreationDate = 1000;
2039 bulkUpdate.ItemData[0].Description = Utils.StringToBytes(item.Description); 2036 bulkUpdate.ItemData[0].Description = LLUtil.StringToPacketBytes(item.Description);
2040 bulkUpdate.ItemData[0].EveryoneMask = item.EveryOnePermissions; 2037 bulkUpdate.ItemData[0].EveryoneMask = item.EveryOnePermissions;
2041 bulkUpdate.ItemData[0].FolderID = item.Folder; 2038 bulkUpdate.ItemData[0].FolderID = item.Folder;
2042 bulkUpdate.ItemData[0].InvType = (sbyte)item.InvType; 2039 bulkUpdate.ItemData[0].InvType = (sbyte)item.InvType;
2043 bulkUpdate.ItemData[0].Name = Utils.StringToBytes(item.Name); 2040 bulkUpdate.ItemData[0].Name = LLUtil.StringToPacketBytes(item.Name);
2044 bulkUpdate.ItemData[0].NextOwnerMask = item.NextPermissions; 2041 bulkUpdate.ItemData[0].NextOwnerMask = item.NextPermissions;
2045 bulkUpdate.ItemData[0].OwnerID = item.Owner; 2042 bulkUpdate.ItemData[0].OwnerID = item.Owner;
2046 bulkUpdate.ItemData[0].OwnerMask = item.CurrentPermissions; 2043 bulkUpdate.ItemData[0].OwnerMask = item.CurrentPermissions;
@@ -2083,11 +2080,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2083 InventoryReply.InventoryData[0].AssetID = Item.AssetID; 2080 InventoryReply.InventoryData[0].AssetID = Item.AssetID;
2084 InventoryReply.InventoryData[0].CreatorID = Item.Creator; 2081 InventoryReply.InventoryData[0].CreatorID = Item.Creator;
2085 InventoryReply.InventoryData[0].BaseMask = Item.BasePermissions; 2082 InventoryReply.InventoryData[0].BaseMask = Item.BasePermissions;
2086 InventoryReply.InventoryData[0].Description = Utils.StringToBytes(Item.Description); 2083 InventoryReply.InventoryData[0].Description = LLUtil.StringToPacketBytes(Item.Description);
2087 InventoryReply.InventoryData[0].EveryoneMask = Item.EveryOnePermissions; 2084 InventoryReply.InventoryData[0].EveryoneMask = Item.EveryOnePermissions;
2088 InventoryReply.InventoryData[0].FolderID = Item.Folder; 2085 InventoryReply.InventoryData[0].FolderID = Item.Folder;
2089 InventoryReply.InventoryData[0].InvType = (sbyte)Item.InvType; 2086 InventoryReply.InventoryData[0].InvType = (sbyte)Item.InvType;
2090 InventoryReply.InventoryData[0].Name = Utils.StringToBytes(Item.Name); 2087 InventoryReply.InventoryData[0].Name = LLUtil.StringToPacketBytes(Item.Name);
2091 InventoryReply.InventoryData[0].NextOwnerMask = Item.NextPermissions; 2088 InventoryReply.InventoryData[0].NextOwnerMask = Item.NextPermissions;
2092 InventoryReply.InventoryData[0].OwnerID = Item.Owner; 2089 InventoryReply.InventoryData[0].OwnerID = Item.Owner;
2093 InventoryReply.InventoryData[0].OwnerMask = Item.CurrentPermissions; 2090 InventoryReply.InventoryData[0].OwnerMask = Item.CurrentPermissions;
@@ -2801,6 +2798,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2801 newPack.Header.Zerocoded = true; 2798 newPack.Header.Zerocoded = true;
2802 OutPacket(newPack, ThrottleOutPacketType.Asset); 2799 OutPacket(newPack, ThrottleOutPacketType.Asset);
2803 } 2800 }
2801
2804 public void SendInitiateDownload(string simFileName, string clientFileName) 2802 public void SendInitiateDownload(string simFileName, string clientFileName)
2805 { 2803 {
2806 InitiateDownloadPacket newPack = new InitiateDownloadPacket(); 2804 InitiateDownloadPacket newPack = new InitiateDownloadPacket();
@@ -2809,6 +2807,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2809 newPack.FileData.ViewerFilename = Utils.StringToBytes(clientFileName); 2807 newPack.FileData.ViewerFilename = Utils.StringToBytes(clientFileName);
2810 OutPacket(newPack, ThrottleOutPacketType.Asset); 2808 OutPacket(newPack, ThrottleOutPacketType.Asset);
2811 } 2809 }
2810
2812 public void SendImageFirstPart( 2811 public void SendImageFirstPart(
2813 ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec) 2812 ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec)
2814 { 2813 {
@@ -2893,8 +2892,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2893 objPropDB.SalePrice = SalePrice; 2892 objPropDB.SalePrice = SalePrice;
2894 objPropDB.Category = Category; 2893 objPropDB.Category = Category;
2895 objPropDB.LastOwnerID = LastOwnerID; 2894 objPropDB.LastOwnerID = LastOwnerID;
2896 objPropDB.Name = Utils.StringToBytes(ObjectName); 2895 objPropDB.Name = LLUtil.StringToPacketBytes(ObjectName);
2897 objPropDB.Description = Utils.StringToBytes(Description); 2896 objPropDB.Description = LLUtil.StringToPacketBytes(Description);
2898 objPropFamilyPack.ObjectData = objPropDB; 2897 objPropFamilyPack.ObjectData = objPropDB;
2899 objPropFamilyPack.Header.Zerocoded = true; 2898 objPropFamilyPack.Header.Zerocoded = true;
2900 OutPacket(objPropFamilyPack, ThrottleOutPacketType.Task); 2899 OutPacket(objPropFamilyPack, ThrottleOutPacketType.Task);
@@ -2925,11 +2924,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2925 2924
2926 proper.ObjectData[0].ObjectID = ObjectUUID; 2925 proper.ObjectData[0].ObjectID = ObjectUUID;
2927 proper.ObjectData[0].OwnerID = OwnerUUID; 2926 proper.ObjectData[0].OwnerID = OwnerUUID;
2928 proper.ObjectData[0].TouchName = Utils.StringToBytes(TouchTitle); 2927 proper.ObjectData[0].TouchName = LLUtil.StringToPacketBytes(TouchTitle);
2929 proper.ObjectData[0].TextureID = TextureID; 2928 proper.ObjectData[0].TextureID = TextureID;
2930 proper.ObjectData[0].SitName = Utils.StringToBytes(SitTitle); 2929 proper.ObjectData[0].SitName = LLUtil.StringToPacketBytes(SitTitle);
2931 proper.ObjectData[0].Name = Utils.StringToBytes(ItemName); 2930 proper.ObjectData[0].Name = LLUtil.StringToPacketBytes(ItemName);
2932 proper.ObjectData[0].Description = Utils.StringToBytes(ItemDescription); 2931 proper.ObjectData[0].Description = LLUtil.StringToPacketBytes(ItemDescription);
2933 proper.ObjectData[0].OwnerMask = OwnerMask; 2932 proper.ObjectData[0].OwnerMask = OwnerMask;
2934 proper.ObjectData[0].NextOwnerMask = NextOwnerMask; 2933 proper.ObjectData[0].NextOwnerMask = NextOwnerMask;
2935 proper.ObjectData[0].GroupMask = GroupMask; 2934 proper.ObjectData[0].GroupMask = GroupMask;
@@ -4533,6 +4532,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4533 } 4532 }
4534 4533
4535 break; 4534 break;
4535
4536 case PacketType.AgentIsNowWearing: 4536 case PacketType.AgentIsNowWearing:
4537 if (OnAvatarNowWearing != null) 4537 if (OnAvatarNowWearing != null)
4538 { 4538 {
@@ -4760,6 +4760,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4760 } 4760 }
4761 4761
4762 break; 4762 break;
4763
4763 case PacketType.UserInfoRequest: 4764 case PacketType.UserInfoRequest:
4764 handlerUserInfoRequest = OnUserInfoRequest; 4765 handlerUserInfoRequest = OnUserInfoRequest;
4765 if (handlerUserInfoRequest != null) 4766 if (handlerUserInfoRequest != null)
@@ -4771,6 +4772,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4771 SendUserInfoReply(false, true, ""); 4772 SendUserInfoReply(false, true, "");
4772 } 4773 }
4773 break; 4774 break;
4775
4774 case PacketType.UpdateUserInfo: 4776 case PacketType.UpdateUserInfo:
4775 UpdateUserInfoPacket updateUserInfo = (UpdateUserInfoPacket)Pack; 4777 UpdateUserInfoPacket updateUserInfo = (UpdateUserInfoPacket)Pack;
4776 handlerUpdateUserInfo = OnUpdateUserInfo; 4778 handlerUpdateUserInfo = OnUpdateUserInfo;
@@ -4787,6 +4789,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4787 visible, this); 4789 visible, this);
4788 } 4790 }
4789 break; 4791 break;
4792
4790 case PacketType.SetStartLocationRequest: 4793 case PacketType.SetStartLocationRequest:
4791 SetStartLocationRequestPacket avSetStartLocationRequestPacket = (SetStartLocationRequestPacket)Pack; 4794 SetStartLocationRequestPacket avSetStartLocationRequestPacket = (SetStartLocationRequestPacket)Pack;
4792 4795
@@ -4850,6 +4853,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4850 handlerLinkObjects(this, parentprimid, childrenprims); 4853 handlerLinkObjects(this, parentprimid, childrenprims);
4851 } 4854 }
4852 break; 4855 break;
4856
4853 case PacketType.ObjectDelink: 4857 case PacketType.ObjectDelink:
4854 ObjectDelinkPacket delink = (ObjectDelinkPacket)Pack; 4858 ObjectDelinkPacket delink = (ObjectDelinkPacket)Pack;
4855 4859
@@ -4869,6 +4873,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4869 } 4873 }
4870 4874
4871 break; 4875 break;
4876
4872 case PacketType.ObjectAdd: 4877 case PacketType.ObjectAdd:
4873 if (OnAddPrim != null) 4878 if (OnAddPrim != null)
4874 { 4879 {
@@ -4888,6 +4893,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4888 handlerAddPrim(AgentId, ActiveGroupId, addPacket.ObjectData.RayEnd, addPacket.ObjectData.Rotation, shape, addPacket.ObjectData.BypassRaycast, addPacket.ObjectData.RayStart, addPacket.ObjectData.RayTargetID, addPacket.ObjectData.RayEndIsIntersection); 4893 handlerAddPrim(AgentId, ActiveGroupId, addPacket.ObjectData.RayEnd, addPacket.ObjectData.Rotation, shape, addPacket.ObjectData.BypassRaycast, addPacket.ObjectData.RayStart, addPacket.ObjectData.RayTargetID, addPacket.ObjectData.RayEndIsIntersection);
4889 } 4894 }
4890 break; 4895 break;
4896
4891 case PacketType.ObjectShape: 4897 case PacketType.ObjectShape:
4892 ObjectShapePacket shapePacket = (ObjectShapePacket)Pack; 4898 ObjectShapePacket shapePacket = (ObjectShapePacket)Pack;
4893 handlerUpdatePrimShape = null; 4899 handlerUpdatePrimShape = null;
@@ -4922,6 +4928,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4922 } 4928 }
4923 } 4929 }
4924 break; 4930 break;
4931
4925 case PacketType.ObjectExtraParams: 4932 case PacketType.ObjectExtraParams:
4926 ObjectExtraParamsPacket extraPar = (ObjectExtraParamsPacket)Pack; 4933 ObjectExtraParamsPacket extraPar = (ObjectExtraParamsPacket)Pack;
4927 4934